Skip to Content
0
Jan 21, 2008 at 04:41 AM

Model Node Invalidation + Remove Element

12 Views

Hi,

I have to treat one of my model nodes as a table and loop it to pass more than one value before i execute the function module.

For doing this, when i do just invalidate, i face a problem.

wdContext.nodeExt_Text_Tbl().invalidate();

The old value is not getting cleared from the second time.The new values are getting appended to the old values every time my code passes new values.

So, the only solution i had is to remove values through one of the below codes (every time after invalidation).

wdContext.nodeExt_Text_Tbl().invalidate();

if

(wdContext.nodeExt_Text_Tbl().size() > 0)

{for(int size=0;size<wdContext.nodeExt_Text_Tbl().size

();size++)

{wdContext.nodeExt_Text_Tbl().removeElement

(wdContext.nodeExt_Text_Tbl().getElementAt(size));}

}

OR

wdContext.nodeExt_Text_Tbl().invalidate();

while ( wdContext.nodeExt_Text_Tbl().size() > 0 ) wdContext.nodeExt_Text_Tbl().removeElement( wdContext.nodeExt_Text_Tbl().getElementAt(0) );

This solves the issue.But i face another big problem. That is, for the first time i call the method, my values are not getting added to the node. Only from the second time i call the method, the values are getting added.

I'm using the same method for another similar node and it works fine. I dont have a clue why i face this behaviour for this node alone. Please do help out..

Thanks in advance,

Kavitha