cancel
Showing results for 
Search instead for 
Did you mean: 

Calling WDDOINIT method.

Former Member
0 Kudos

Hello All.

In my application i have 2 views. Say View1 and View2.

If i navigate from View1 to View2, i want to call view2's wddoinit method.

And if i navigate from view2 to view1 i have to call view1 wddoinit method.

To put it simple each time i go to a view i need to call that view's wddoinit method.

How to achieve this.

Regards,

SampathKumar.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank You All

Former Member
0 Kudos

Hi,

Just write call method wddoinit in the event handler method of the inbound plug in View 1.

WDDOINIT is called automatically when a controller is initialized for the first time.

But it is not advisable to call Hook methods explicitly,as they are handled by the framework directly.

Regards,

Runal

Edited by: Runal Singh on Jun 22, 2009 10:17 AM

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi.

While going from one view to another view i am getting the modify method being called.

But i want the init method to be called.

Regards,

SampathKumar.

Former Member
0 Kudos

Hi,

What is your requirement.

Regards,

Lekha.

Former Member
0 Kudos

Hi.

when i move from one view to another and come back to the original one either the previou user data are there or the current users previous data are there.

regards,

SampathKumar

Former Member
0 Kudos

Hi,

I think you are getting the data for the users in the WDDOINIT methods. When you get this data, store them globally so that you can avoid calling the WDODOINIT methods.

Regards,

Lekha.

Former Member
0 Kudos

Hi ,

For this scenario i suggest you use the eventhandler method created by the Inbound Plug.

This event handler of an inbound plug is always triggered when the view is called.

For eg: if you create an inbound plug for the view IP_MAIN, HANDLEIP_MAIN is created automatically.

You can place your code in here.

Hope this helps!

Regards,

Radhika Vadher.

alejandro_bindi
Active Contributor
0 Kudos

- Create one new method on each of the view controllers, say mymethodv1 and mymethodv2. Move the code in WDDOINIT to those methods and call each method from each WDDOINIT method (so far the end result would be the same as you have now).

- Now call both new methods also from each of the inbound plug handler methods.

The plug handlers should be the place where you execute code upon navigation. If that code must be the same that you execute in WDDOINIT, then isolate it on a separate method and reuse it from both places...

As it was stated, hook methods (WD*) should NOT be called explicitly.

Regards

former_member283828
Participant
0 Kudos

Hi,

Invalidate the attributes which are responsible for the i/p fields in View 1 before navigating to the VIEW 2.

do the same as above before navigating to the view1 from view2.

If all the attributes which are responsible for the i/p fields in View 1 are present under the same node then you can directly invalidate the node using the method.

IF_WD_CONTEXT_NODE->INVALIDATE( ).

Regards,

Kiran Kumar

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

On the View Properties tab change the Lifetype from Framework Controlled to When Visible. This will cause the WD Framework to destroy the view and all data of the view context whenever it is no longer visible. That way your WDDOINIT will fire on each return to the view as though it was the first load.

former_member192818
Active Participant
0 Kudos

Thanks Thomas, You are the best.

0 Kudos

Thanks Thomas.

It worked even for me.

Regards,

Chitrasen

Former Member
0 Kudos

@ Thomas..i ve been thinking , that we need to break the framework control by explicitly calling INIT everytime

wonderful option...i wish i could give points too.

Regards

G