cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a method in view from component controller?

Former Member
0 Kudos

Hi,

Is it posible to call a method that is defined in the Component Controller in the View?

If it is posible please give some sample code how to call the method?

Regards,

Padmalatha.K

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Add the controller as part of Required Controllers

and use the following code

wdThis.wdGet<ComponentName>Controller().<MethodName>()

Ex:

wdThis.wdGetTestCompController().getData();

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

But the method is not defined in the methods tab. I created the method in the "Others".

So is it posible to call the mehod in view?

Regards,

Padmalatha.K

Former Member
0 Kudos

Hi,

if you refer this //@@begin others

No

Create a method in method in method tab and then deligate the call to this method

Regards

Ayyapparaj

Answers (2)

Answers (2)

former_member191569
Active Participant
0 Kudos

Padmalatha, all the methods defined in a controller from 'Methods' tab are instance methods. An instance method defined in a component controller is callable from any view controller that holds a reference to the component controller.

Defining methods between the tags


//@@begin others

//@@end

is useful if you want to declare static methods.

Former Member
0 Kudos

Hi,

You can call the the method defined in Component Controller in a View. Use the following code.

wdThis.wdGet<ComponentName>Controller().<MethodDefined in Component Controller>();

Thanks & Regards,

Jhansi Miryala