Skip to Content

Model Node Invalidation + Remove Element

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 21, 2008 at 04:50 AM

    Hi,

    The link below deals with the same problem.

    [strange-issue-clearing-context-element]

    Hope it will help you.

    thanks & regards,

    Manoj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 06:36 AM

    Hi Kavitha,

    Use same code before executing the Function Module.

    Hope this will solve your problem

    Thanks

    Sandy

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 22, 2008 at 10:18 AM

    My problem solved with my collegue's help. All we did is, just add the values in an alternate method as shown below. Eventhough my previous method should work fine, we donot have a reason for the issue.

    Bapimepotextheader LongTexts = new Bapimepotextheader();

    LongTexts.setText_Line(SubstringVal);

    LongTexts.setPo_Item("00000");

    LongTexts.setText_Form("*");

    LongTexts.setText_Id("F01");

    IPublicCC_OrderReliefAid.IExt_Text_TblElement objExt_Text_TblElement = wdContext.nodeExt_Text_Tbl().createExt_Text_TblElement(LongTexts);

    wdContext.nodeExt_Text_Tbl().addElement(i,objExt_Text_TblElement);

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.