cancel
Showing results for 
Search instead for 
Did you mean: 

doubt in Java Webdynpro wddoInit( )

Former Member
0 Kudos

Hi.

The scenario is:

I have two views related using plugs.

first view has a table with set of records(for ex: name, empid, dept)

second view has text fields to be entered for all the above mentioned fields (name, empid, dept).

This view has 2 buttons, save and cancel.

If i click save button it saves the record and add the record to the table.

If i click cancel button, it shows me the table (first view).

I have written code in view1, wdDoInit( ) method to call a method X which gets data to be filled in the table.

In view 2 while save is clicked im calling the same method X. which adds new row and populates the table.

The problem comes here.

when I click cancel button, it shows me the view1 with table as empty. since im calling the method in wdDoInit() to populate the table.

when the cancel button is pressed it is not going to init method again. Im not sure how to proceed

Can anyone help me on this issue.

Regards

Bala

Accepted Solutions (1)

Accepted Solutions (1)

former_member85655
Active Participant
0 Kudos

I guess the collection is still not empty . You might try to rebind the collection back to that context. Maybe write a action to a plug fired from View 2 to view 1.

Regards,

Arun

Answers (2)

Answers (2)

Former Member
0 Kudos

Instead of writing your code in the wdDoInit()-method, make a private method eg. setData() where your write your code in.

in the wdDoInit() call this method with this.setData().

On the plug-method where you entered the view again you can call this method again with this.setData();

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Init method will be called only once, after that it wont be called.

So write the code somewhere in onplug method

Regards,

Vijayakhanna Raman