412
Views
11
Comments
Solved
How to use Widget_Click for a navigate link
Question

Hi,

I am new to outsystems, can anyone tell me what to use instead of widget_click for any link having navigate function.

I have tried 

1."$("+ Widget_Id +").trigger('click');"

2."$('#" + Widget_Id + "').click();"

in RunJavaScript but to no avail as i have Widget_Id as a variav=ble in my function.

Please help me as i am stuck in this scenario.

Thanks in advance.



Rank: #389
Solution

Hi Ishan, 

When triggering the 'AlreadyDeletedContent..." screen action, you can go ahead and change the RunJavaScript action by a Widget_Click that clicks a button that has its method as AJAX submit and calls another screen action that ends with a navigation node instead of the 'End' node you have in this image above. 

Best Regards

Rank: #389

Hello Ishan,
may I ask how are you calling that RunJavaScript action? 

Take in mind that the widget_click have these limitations above.
Best Regards

Rank: #2770

Hi Ishan,

I could be wrong, but that looks like jQuery. Have you imported the min.js file for jQuery in your application?


Another thing you could try that does not use jQuery is "document.getElementById(' "+ Widget_Id +" ').click();" 

The .click(); function should work normally on a button or link with any method - Navigate, Submit, and Ajax Submit.

Rank: #120

Hi Ishan,

You can achieve the same result with this javascript:

window.location = $('#' + WidgetId).attr('href');

This doesn't trigger the link's click handler, but redirects the browser to the link's destination.

Rank: #89

Hi Ishan,

Use this way to call button click event instead of widget_click action-

Line - Link Or Button Name - "HdnCurrency"


SyntaxEditor Code Snippet

"$('#"+HdnCurrency.Id+"').click();"
Rank: #389
Solution

Hi Ishan, 

When triggering the 'AlreadyDeletedContent..." screen action, you can go ahead and change the RunJavaScript action by a Widget_Click that clicks a button that has its method as AJAX submit and calls another screen action that ends with a navigation node instead of the 'End' node you have in this image above. 

Best Regards

Rank: #389

Hi Ishan, 

I'm glad it worked as you expected! 

Best Regards

Rank: #32903

I am relatively new to OS.  I make frequent use of Click_Widget.

In reading this post I'm wondering if there is a down side to use of this Rich Widget.

I specifically use it to refresh a list a list in a page that has inputs (i.e. filters) that would change what records are returned.

Many thanks for any perspective.  You guys are all great how you help everyone out.

Scott