Performing a screen action before calling a popup scree

Performing a screen action before calling a popup scree

  

Hi Everyone,


Currently, I have a button and clicking on it, a popup screen will open.

I want to perform some action before calling the popup screen. But Outsystems is not allowing me to have an action while calling Popup screen. As the Submit method should be "Navigate", I am not able to perform any action.

What is the solution for this? Please help.


Regards,

Anantha

Solution

Hi Ananth,

You can use a new link (that uses the Ajax Sumbit method) to call a Server Action that runs both your logic and a simple snippet of JavaScript that opens/clicks your original Navigate link (to which your Popup editor widget is associated). 

Your new link will be the one visible to your users and your original link will be hidden using the extended properties to define a style of "display: none".

I included below a step by step example that hopefully will be helpful.

Example:

  1. Create a new link (that your end-users will click to open the popup) with the Ajax Submit method and set it's destination to a new user action (OpenPopup action in this example);
  2. Set the style of your original link to "display: none" using the extended properties;
  3. Add the reference to the RunJavaScript server action from HTTPRequestHandler in the Manage Dependencies window;
  4. The user action (OpenPopup action in this example) that is called when your end-users press the visible link should use the RunJavaScript server action with JavaScript that will open your original "hidden" link.
    Remember to replace the "HiddenOpenPopup.Id" with the Id of your original link  "$('#"+HiddenOpenPopup.Id+"').click();"
  5. Add your logic before the RunJavaScript Action.

    Cheers
Solution

Hi Ananth,

Set the method type of Button as 'Ajax Submit' and give it a destination as an screen action, and write all your code which you want to run before opening that popup. After this, before the end node of that screen action, use the Outsystems build in action called as "Widget_Click". Through this make a click of hidden button and for that hidden button set its method type to "Navigate" and link that button with the popup. So that popup will open.

I hope the above solution will solve your problem.

João Batista wrote:

Hi Ananth,

You can use a new link (that uses the Ajax Sumbit method) to call a Server Action that runs both your logic and a simple snippet of JavaScript that opens/clicks your original Navigate link (to which your Popup editor widget is associated). 

Your new link will be the one visible to your users and your original link will be hidden using the extended properties to define a style of "display: none".

I included below a step by step example that hopefully will be helpful.

Example:

  1. Create a new link (that your end-users will click to open the popup) with the Ajax Submit method and set it's destination to a new user action (OpenPopup action in this example);
  2. Set the style of your original link to "display: none" using the extended properties;
  3. Add the reference to the RunJavaScript server action from HTTPRequestHandler in the Manage Dependencies window;
  4. The user action (OpenPopup action in this example) that is called when your end-users press the visible link should use the RunJavaScript server action with JavaScript that will open your original "hidden" link.
    Remember to replace the "HiddenOpenPopup.Id" with the Id of your original link  "$('#"+HiddenOpenPopup.Id+"').click();"
  5. Add your logic before the RunJavaScript Action.

    Cheers


Thanks a lot! It worked :-)

Pravi Gupta wrote:

Hi Ananth,

Set the method type of Button as 'Ajax Submit' and give it a destination as an screen action, and write all your code which you want to run before opening that popup. After this, before the end node of that screen action, use the Outsystems build in action called as "Widget_Click". Through this make a click of hidden button and for that hidden button set its method type to "Navigate" and link that button with the popup. So that popup will open.

I hope the above solution will solve your problem.

Hai pravi,

Popup is opened. but action is not worked..I want to crop the image and set as a profile..I have attached the oml file can you pls help me


Regards,

Jeyasri