cancel
Showing results for 
Search instead for 
Did you mean: 

How to use one pop up window for multiple buttons and input fields?

Former Member
0 Kudos

Hi Experts,

I have created a pop up window that will be opened from multiple buttons in the same view. There are input fields that the data will be populated from a pop up window. How can I set up which button that a pop up window is opened from? I also would like to populate the data from a pop up window to the input field next to a clicked button. There are 6 buttons and 6 input fields that share the same pop up window. I would very appreciate your responses.

Thank you,

Don

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can also launch event from your actions buttons and catch them in the parent window.

roberto_tagliento
Active Contributor
0 Kudos

NGUYEN VAN THAN clement is right.

The pop-up window must RAISE and EVENT with the right return ID parameters.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for all of your responses.

I created a context attribute say "ButtonClicked" for example and mapped it with a controller, a parent view, and a popup view. Each button has its own action but opens the same popup view. In the wdDoInit of the popup view, I set the value of a ButtonClicked attribute according to the button that I click. For example, if I clicked on button A, I set it to "A". Then the event handler of the parent view, I check what value of "ButtonClicked" is. If ButtonClicked == "A" then populate Input field A.

former_member214651
Active Contributor
0 Kudos

Hi,

Try creating 2 context attributes, one in your component controller and the other in the pop-up view. Bind the attribute of pop-up view to the component controller attribute.

In the main view, on click of every button set a unique code in the controller's context which helps you in identifying the button clicked. Since u have created a binding to the pop-up view attribute the value flows from the controller.

In the init method of your pop-up view, check the value of the attribute and based on that display which ever UI elements are required.

Eg:

On Button 1 click set value "B1", Button 2 value "B2" etc. In the init() of pop-up view u can check the values and perform the required operation:

if(("B1").wdContext().currentContextElement().getButtonIdentifier()){

}

else...{

}

Hope this helps you.

Regards,

Poojith MV