cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a method from another view in view

former_member210563
Participant
0 Kudos

Hi,

I have 2 views: INPUTVIEW and MAIN.

I have a method for finding data in INPUTVIEW and I want to call that method in my view MAIN. When using the wizard, I only

get the methods from the current.

How can I call that method ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Peter,

Calling method of view from different view is not possible .

Make that method in component controller and access in both different view .

thanks and regards,

Anup Banerjee

Former Member
0 Kudos

you have below 3 options for this

1. Write the method in Component Controller and call from any view

2. Write the method in Custom Controller and call from any view

3. Write the method in Assisance Class and call from any view

Hope it helps..

Answers (2)

Answers (2)

sahai
Contributor
0 Kudos

Hi,

The data in any WDA component resides in Nodes/attributes.

Now in your case you want to read the node in your second view, after it gets its value set in first view. For this you can do the following:

Option 1: Make a node in the component controller and then drag drop this node in both the views, Doing this will make the node as public and this will be visible throughout the component.

NOTE: this is not recommended when you are using this as a banking application

Option 2: You can use assistance class and set the node with values and read these values again using the methods of your assistance class.

The option 2 is more reliable and robust to use.

Let me know in case you want more detailed explanation on the same.

Thanks and Regards,

Shitanshu Sahai

Former Member
0 Kudos

if you want to use same node data in two different view then put nodes in component controller and create method for filling and retriving node data in component controller then you can access same node data in two view by calling these method in view