Widget Click

Hi All,

Is there any possibility to handle widget click kind of scenario in web screen Preparation? so that i can trigger a button after preparation ends.

Please advice. Thanks in advance!



Regards,

S.Saravanan


Hi, Saravanan,


You can execute a javascript function as follows:

Or 


Best regards!

Saravanan Santhanam wrote:

Hi All,

Is there any possibility to handle widget click kind of scenario in web screen Preparation? so that i can trigger a button after preparation ends.

Please advice. Thanks in advance!



Regards,

S.Saravanan


Hi Saravanan, yes you can do it like I find in the pic:

you add the RunJavascript from the HttpRequestHandler and you should use the ready() method that is used to make a function available after the document is loaded. Whatever code you write inside the $(document ).ready() method will run once the page DOM is ready to execute JavaScript code.


Hope I could help you

Solution

Hi Saravanan,

If you are having such requirement, you can use the Widget_Click Server action by passing the Button_Id as the server action WidgetId Input parameter in the preparation action flow itself, as shown below.

RichWidgets > Widget_Click


Check this: Sample App Screen

IMP Note: Set the Button Method as Ajax Submit in order to avoid the infinite loop. i.e. If you set the Button method as Submit - on the completion of button action flow, it will reload the preparation action flow and because of the Widget_Click node, again the button action flow will get invoked, creating a infinite loop. (Please make a note, the mentioned NOTE point is relevant/applicable for any approach you follow in order to click a button from the Preparation action flow).


Hope this helps you!


Regards,

Benjith Sam

Solution

Benjith Sam wrote:

Hi Saravanan,

If you are having such requirement, you can use the Widget_Click Server action by passing the Button_Id as the server action WidgetId Input parameter in the preparation action flow itself, as shown below.

RichWidgets > Widget_Click


Check this: Sample App Screen

IMP Note: Set the Button Method as Ajax Submit in order to avoid the infinite loop. i.e. If you set the Button method as Submit - on the completion of button action flow, it will reload the preparation action flow and because of the Widget_Click node, again the button action flow will get invoked, creating a infinite loop. (Please make a note, the mentioned NOTE point is relevant/applicable for any approach you follow in order to click a button from the Preparation action flow).


Hope this helps you!


Regards,

Benjith Sam


Hi Ben,

Actually I am using widget click in the web block preparation when I try to trigger a hidden button with feed back message as normal it works fine. But when I try to trigger the action which contains event the widget click is not getting triggered.I need to fire one widget click action which triggers event so I can pass my value to the parent screen.

Saravanan wrote:

Hi Ben,

Actually I am using widget click in the web block preparation when I try to trigger a hidden button with feed back message as normal it works fine. But when I try to trigger the action which contains event the widget click is not getting triggered.I need to fire one widget click action which triggers event so I can pass my value to the parent screen.

Hi Saravanan,

Even though, you have the objective to click the hidden button defined within the webblock, you can follow the same steps.

1) Define a Widget_Click server action within the webblock preparation action flow, passing the Button Id to the Widget_Click server action.

2) Set the Button display property to none - i.e. Define the style = display: none; in the hidden button extended properties section (Note:  Button Visible property must be set to True value)

3) Introduce an event within the button action flow as per your requirement (in my sample app, I passed - 7 value from webblock to the parent screen using event mechanism).


Check this: Sample App Screen

I guess, your webblock hidden button is not working because you might have set the button Visible property to False, instead of that you must define the hidden button - Extended properties as mentioned below

Code Snippet

style = "display: none;"

Hope this helps you!


Regards,

Benjith Sam