cancel
Showing results for 
Search instead for 
Did you mean: 

hook methods in component controller vs hook methods in view controller

Former Member
0 Kudos

Hi,

I want to know how WDDoInit in component controller differs from the same in view controller.

How the lifecycle flows in both controllers?

Eg. if i create a method intialize() in both component  & view controllers and if i called initalize method in view, which one will be called?

Need to know how the flow works.

Regards,

Manoj


Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Dear Manoj,

Please check if it is helpful.

The order of execution of standard hook methods when a WDJ application is called the first time is as follows:

1. Component Controller DoInIt()

2. View Controller DoInIt()

3. Interface Window Controller

4. Component Controller DoBeforeNavigation()

5. Component Controller DoModify()

6. Component Controller DoPostProcessing()

After this, if you navigate to some other view, then the order of execution of methods of that New view will be:

1. Component Controller DoBeforeNavigation()

2. New View DoInIt()

3. New View onPlugfromFirstView

4. Component Controller DoModify()

5. Component Controller DoPostProcessing()

Then, if you again navigate back to the first view, then the order of execution of methods is:

1. Component Controller DoBeforeNavigation()

2. New View onPlugfromNewView

3. Component Controller DoModify()

4. Component Controller DoPostProcessing()

Thanks & Regards,

Patralekha

Former Member
0 Kudos

Hello Patralekha,

Thanks for the answer.

I need answer for the second part also: "if i create a method intialize() in both component  & view controllers and if i called initalize() method in view, which one will be called?"

Could you help me?

former_member191044
Active Contributor
0 Kudos

Hello Manoj,

if you are new to WD4J and not sure about the excution of methods then just set some breakpoints and debug your component. This helped me alot when i was learning WD4J.

Hope this helps,

Tobias

Former Member
0 Kudos

Hello Manjo,

From your post I understand that you are calling the initialise() method in view.

If your syntax of calling the method initialise is just initialise() then you are calling the method which you have written int the view.

But If your syntax is wdThis.wdGet(ComponentControllerName)Controller.initialise() then you are calling the method which you have written in the component controller.

Regards,

Priyanka Devadiga

Former Member
0 Kudos

Hi Priyanka,

Thanks for your answer. Got it now.

Cheers,

Manoj

Answers (1)

Answers (1)

govardan_raj
Contributor
0 Kudos

hi manoj,

The wdDoinit() of component controller will be called first  when application loads.

Now you have specified that you have created intialize methods , in both controllers, so think

view_intialize() in view controller and comp_intialize() in component , and in wddoInit()  of view .....which method you are calling ?

Regards

Govardan