Skip to Content
author's profile photo Former Member
Former Member

doubt in Java Webdynpro wddoInit( )

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

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • Best Answer
    Posted on Aug 02, 2006 at 10:52 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 10:52 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 11:00 AM

    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();

    Add comment
    10|10000 characters needed characters exceeded