cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with invalidate method

konchada_saikrishna
Active Participant
0 Kudos

Hi all,

In my application, I need to store a table of entries to R/3, where "persontable" is the table

1) I placed a button "ADD" in the "view1", on click, a window is poped with fields and "ADD ROW" button.

Onclick of this "ADD ROW" button I create a new element to the "persontable" and set all the fields from the window.

In this way user is allowed to enter as many rows he can.

2) On click of save button, a method from custom controller is called to execute the bapi.

3) Then I wrote wdContext.nodepersontable().invalidate(); after wdContext.nodeOutput().invalidate();

4) But when I go to the view1 again, the rows in the person table still exist.

I need the person table to be empty when I visit the view1 again.

Please help me ....

Thanks in advance.

Regards,

Sai.K .K

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos
suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Sai,

I think you directly bounded model to the table. check in the controller model what is model class which you binded to table.

bind the class variable without data.

Modelclass newclass = new Modelclass();

wdContext.nodepersontable().bind(newclass );

Regards, Suresh KB

Former Member
0 Kudos

Hi,

Nullify the persontable outputnode.

try this.

for(int i = (wdContext.nodeBapi().size()-1);i>0; i--)

{

wdContext.nodeBapi().removeElement( wdContext.nodeBapi().getElementAt(i));

}

Thanks

Lohi

Message was edited by:

Lohitha M

konchada_saikrishna
Active Participant
0 Kudos

Hi Lohitha,

This worked fine, but insted of this approach, why is that the invalidate method is not working.

The node is binded to the view context and UITable at design time, and there is no other node that fills elements to this node.

Regards,

Sai.K.K

Former Member
0 Kudos

Hi Sai,

Node will be invalidated by invalidate() method. It clears its element list and calls the supply function again when asked for an element.

This will cause all references in the model node’s element collection to be discarded and resynchronised with the new data found in the model object.

(Def taken from "InsideWebDynpro" )

Regards, Anilkumar