cancel
Showing results for 
Search instead for 
Did you mean: 

Method usage

Former Member
0 Kudos

Hiee All,

I have created one method in one view implementation.I want to use that method in another view,how can i do that?how to call that method from other view?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

arun_srinivasan
Contributor
0 Kudos

Hi

Yes as said by ashwani you cann't access the method of one view to another view and also you can acces from view to comp ctroller not from comp ctrl to view

In the view 1 define the usage of component controller

In the component controller create a method

//@@begin javadoc:cc_method()

/** Declared method. */

//@@end

public void cc_method( )

{

//@@begin cc_method()

//@@end

}

In the view 1 call the component controller method like this

//@@begin javadoc:method1()

/** Declared method. */

//@@end

public void method1( )

{

//@@begin method1()

wdThis.wdGetTest1Controller().cc_method();

//@@end

}

Regards,

Arun

Former Member
0 Kudos

Hi Arun,

I got one more doubt .when should we declare the usage of controller?

I mean is it necessary to declare it when we map to the context of controller and view or only when we want the method in the controller.Clarify me.

Thank you.

Former Member
0 Kudos

HI,

For context mapping as well as for calling method, the usage of controller is needed.

One more thing, You can also use custom controller also for these purposes.

There u can create ur own methods(similar to comp or interface controller) and define it's usage in view controller

Regards

Fahad Hamsa

arun_srinivasan
Contributor
0 Kudos

Hi

For both thing(Either context mapping betwen view an dcomp ctrller or using the comp controller method in view) you have define the usage of component controller in the view.

When you do context mapping via open data modeller (Right the component you will see data modeller option) in this case usafe is automatically added while you drag the mapping

Hope this helps,

Let me know if issue is solved or not

Thanks and Regards,

Arun

arun_srinivasan
Contributor
0 Kudos

Hi

For both thing(Either context mapping betwen view an dcomp ctrller or using the comp controller method in view) you have define the usage of component controller in the view.

When you do context mapping via open data modeller (Right the component you will see data modeller option) in this case usafe is automatically added while you drag the mapping

Hope this helps,

Let me know if issue is solved or not

Thanks and Regards,

Arun

arun_srinivasan
Contributor
0 Kudos

Hi

For both thing(Either context mapping betwen view and comp ctrller or using the comp controller method in view) you have define the usage of component controller in the view.

When you do context mapping via open data modeller (Right the component you will see data modeller option) in this case usafe is automatically added while you drag the mapping

Hope this helps,

Let me know if issue is solved or not

Thanks and Regards,

Arun

Former Member
0 Kudos

Hi Arun,

my issue and doubt both are solved.

Thank you.

Answers (1)

Answers (1)

former_member186016
Active Contributor
0 Kudos

AFAIK You cann't access the method of one view accessed directly.

You can make the common methods moved in component controller or interface view controller. Later you can add these controller as used controllers in view controller and use the method.

Best Regards,

Ashwani KR Sharma