cancel
Showing results for 
Search instead for 
Did you mean: 

Invalidate Model node and isEmpty

former_member540174
Participant
0 Kudos

I have the following model node in my custom controller


ModelNode1
---elem1
---elem2
---nodeList_By_Pernr_Input
-----elem1
-----elem2
---nodeList_By_Pernr_Output
-----nodeList_By_Pernr_Attendee_List_Output
-----nodeList_By_Pernr_Pernr_List_Output
-----nodeList_By_Pernr_Return

In my code (which can be looped though several times due to a back button) I invalidate the model's output node (for grins I even invalidated the node inside the node I invalidated (do I need to do this?))


wdContext.nodeList_By_Pernr_Output().invalidate();	
wdContext.nodeList_By_Pernr_Attendee_List_Output().invalidate();

After returning from the method that invalidated I do the following


 if (wdContext.nodeList_By_Pernr_Attendee_List_Output().isEmpty())
{
 wdComponentAPI.getMessageManager().reportSuccess("Debug MMRC nodeList_By_Pernr_Attendee_List_Output is Empty");
}
else
{
 do some logic..
}

It is doing the logic! I thought by invalidating a node it would be empty?

Diane

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Diane,

The method invalidate() works differently for modelnodes and valuenodes. The method invalidate() makes empty value nodes only.

For model nodes invalidate() refreshes the data but don't make them empty. You have to explicitly make them empty

like

for (int i = node.size(); i > 0; i--)
node.removeElement(node.getElementAt(i - 1));

regards,

Siva

Answers (0)