cancel
Showing results for 
Search instead for 
Did you mean: 

How to call WDDOINIT() method ?

Former Member
0 Kudos

Hi,

1.Can we call WDDOINIT() method from any other method ??

2.if yes can we call WDDOINIT() method present in one view ,from any other method

present in some other view?? and how can do that?

Thanks,

Deepika

Accepted Solutions (1)

Accepted Solutions (1)

former_member201361
Active Contributor
0 Kudos

hi,

wdDOInit method is a hook method which would called by the framework to initialize the controller. and this method is going to be called only once to initialize .so we can't have a controll on the wdinit() .

Former Member
0 Kudos

Hi,

Then my qst is : if view 1 will call view 2, at that time wddoinit( ) method will be called or not??

if not, then which method will be called when we ll call view 2 from view 1???

Actually,my requirement is:

a. In view 1's wddoInit( ) method i wrote one select statement which will select data from pa0023 table.

b. in view 2 i m inserting one record to the above pa0023 table.

c. so when i will go back from view 2 to view 1, i should get the newly inserted record in view 1 ( which i have inserted in view 2).

For this condition what i need to do ?? can u please suggest??

can we use any other system defined method?

Thanks,

Deepika

Former Member
0 Kudos

Hi Deepika,

wdDoInit() is almost same like init() method in servlets. everytime ur view is initialized , it will be called by framework.

For ur requirement, better u store values from both views in component controller's context & get the values from there. make sure while navigating u refresh ur table . that should solve ur problem.

regards

Sumit

Former Member
0 Kudos

Hi Sumit,

If i can refresh the table means my problem is solved...

but how can i Refresh my table???

Now only if i ll press the refresh button of IExplorer , i m getting the newly inserted data other wise not..

Please suggest.

Thanks,

Deepika

Former Member
0 Kudos

Views don't "call" each other, you can only navigate between them. To share data between views use context mapping.

Armin

Former Member
0 Kudos

Hi

whatever the value inserted in the view 2 should be get displayed in view 1.

You will be having a value node with value attributes binded with the pa0023 table.

Create Context mapping so that value node will shared with the View1 and view2 (Create that value Node in the Component Controller).

Whenever you insert the values in the View 2, first invalidate node and then insert the values and now navigate to the view1. You will find the record what you inserted in the view 2.

Regards

Chandran S

SB9
Active Participant
0 Kudos

Hi,

When you navigate from view 1 to view 2 you can invalidate the node which is binded to the Table View. This will cause it to get refreshed.

HTH!

S-B

Former Member
0 Kudos

Hi Deepika,

From the problem statement, what I understand is, you have 2 views, view1 and view2. On view1 you perform some operation, which will cause updation of the data shown on view2. For view2, the Data Retrieval Logic is performed in wDoInit() method and hence you are not able to get the updated data.

If this is the case, then instead of using hook method wDoInit(), as you will be navigating between Views with the help of plugs, use onPlugFrom<View1> method in view2 for the Data Retrieval Logic.

Hope it helps.

Regards,

Alka.

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks a lot for your answers.

Former Member
0 Kudos

hi deepika,

It is possible to invoke wddoinit() method from anywhere,

case 1:

1. use this keyword, to call wdDoInit() method from anyother method present inside the same class.

2. Or, just create an Instance of your class.

Example,

SampleView sample = new SampleView(wdThis);

case 2:

1. Create a context attribute in Componenet Controller, of type

mentioning your view. eg: IPrivateSampleView.

to select this type,

goto properties of context attribute, select type, you can find one popup window, in that, select java native type, and select browse, and just enter IPrivate, now you can able to see your view name there, then select appropriate type.

2. Map that context to both views using context mapping, now initilize that context attribute, from first view as follows

wdContext.current<Nodename>.set<attributename>(wdThis);

3. From another view just create reference,

SampleView sample = wdContext.current<Nodename>.get<attributename>(wdThis);

Former Member
0 Kudos

hi,

You can call wddoinit() method however, it is mainly required to initialisation purpose. If you need to use the same coding, write it in another and then call it according to need.

And while using view, we have to keep in mind that the life-time of a viewcontroller is only till the view is open, so if the controls paases to another view, then it is not possible to call any method wddoinit() of another method because that view too will have another wddoinit() method of its own.

regards,

pinki

Former Member
0 Kudos

Theoretically, yes, but you shouldn't. The hook method are called by the framework and should not be called by application code. If you want to call the code inside wdDoInit() from other methods too, just put it into a separate method and call this from both places.

Armin