cancel
Showing results for 
Search instead for 
Did you mean: 

Method callable in both controller and view

Former Member
0 Kudos

I'm using the same piece of code in both the component controller and a view. I would like to put the code in a method and call it from both places but I wonder what would be the best place to put this method.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Create a method in controller.

In controller you can directly call the method by its name

In view you can call the method using wdThis.wdget<componentcontrollername>controller().<methodname>();

Regards,

Murtuza

Former Member
0 Kudos

Create the method using Method tab in your component controller and you will get all the necesaary comments added there.

Regards,

Murtuza

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Create this method as part of the controller and call if from

controller and view.

From view call the method as follows

wdThis.<b>wdGet<Component>Controller().<methodName>();</b>

Regards

Ayyapparaj

Former Member
0 Kudos

Thanks for the replies. Should this method go between "//@@begin others" and

"//@@end" ?

Former Member
0 Kudos

hi,

In the methods tab of the controller.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi! Lieven,

What they mean is go to Component controller,click on method tab and create a new mthod by pushing the New Button.

go to implementation tab of controller and selected the created method in outline view,Paste your code between

//@@begin wdDoBeforeNavigation()

your code goes here....

//@@end

regards,

Mithileshar