cancel
Showing results for 
Search instead for 
Did you mean: 

Invalidate vs. Empty

former_member540174
Participant
0 Kudos

I have a node that is called many times. This node contains other nodes and elements.


Node1
-- elem1
-- elem2
-- node2
------elem1
-- node3
------elem1
------elem2

I have situations where I want to "empty" it all. -note my code is looking at times at node2 directy and node3 directly for size or "isEmpty".

I called the invalidate method for Node1. If I were to look at node3 with an "isEmpty" will it be empty? Will the size be 0?

Should I rather removeElement for node1, node2 and node3?

Diane

Edited by: Diane Fuller on Mar 17, 2008 6:06 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes Diane,Invalidate should remove any element association with a node and its children and you could use isempty to test that.

Ashok

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

Both of them are used in relation to nodes.

The invalidate method is used to invalidate a node.It returns void.

The isEmpty method is used to check whether the node is empty or not. It returns bolean value.

Former Member
0 Kudos

Hi,

Invalidate:This methode will invalidate the node.

The node can be filled by binding elements to it.Its content can be invalidated.

isEmpty():Returns whether the element list is empty.

This will return the boolean value.

If mandatory is false, the node is initially empty. Then all UI elements bound to

this node are empty and read only. If mandatory is true, the node non-empty upon access.

This is very convenient for value nodes.

Regards,

Lavanya.G