Hi,

I'm wondering how you trigger a click event on a button without actually clicking it. I want to be able to click on a button which will cause a different button to be clicked. I've created the button, set the 'visible' property to false.... Does anyone know where I go from here?

Thanks

Try to use the widget_click action from the rich widgets?
I can't find this in OutSystems 8.0. Is it only in a later version?
Did you add check the action in the "Add/Remove Dependencies" After that it should be available for use in the Logic Tab under Richwidgets.
Ah, I didn't know you could do that (I'm quite new to OutSystems). Thanks so much, you've saved me a lot of trouble!

Is it possible to call this action from a url?  I am using Dynamic Menus from the Forge, which creates a menu based on the Level of the url (nesting) and the url that is set.

Hi 

What are the specifications for widget click. For some reason it doesn't appear to work.

Ashish Sarwal wrote:

Hi 

What are the specifications for widget click. For some reason it doesn't appear to work.

Trigger screen action internally

https://is.gd/jL73rW


Olivia Beech wrote:

Hi,

I'm wondering how you trigger a click event on a button without actually clicking it. I want to be able to click on a button which will cause a different button to be clicked. I've created the button, set the 'visible' property to false.... Does anyone know where I go from here?

Thanks

Hi Olivia Beech,

You can use Runjavascript server action

"$('#"+Button.Id+"').click();"



Olivia Beech wrote:

Hi,

I'm wondering how you trigger a click event on a button without actually clicking it. I want to be able to click on a button which will cause a different button to be clicked. I've created the button, set the 'visible' property to false.... Does anyone know where I go from here?

Thanks

Hi Olivia Beech,

Do not set the button visible to false, because it will make your button can't be accessed from anywhere.
But change the style to "display:none".
And to trigger click event for that button, inside an client action (example another button action) use Runjavascript action from HTTPRequestHandler with script :

SyntaxEditor Code Snippet

"document.getElementById('"+Yourbutton.Id+"').click();"

Good luck!


Olivia Beech wrote:

Hi,

I'm wondering how you trigger a click event on a button without actually clicking it. I want to be able to click on a button which will cause a different button to be clicked. I've created the button, set the 'visible' property to false.... Does anyone know where I go from here?

Thanks

You can use the runjavascript server action as said above for:

"$('#"+Button.Id+"').click();"

If you are wanting to 'click' the button but not have it displayed on the page, make sure the visible is = true and in the extended properties of the button put:

style
= "display: none;"


I hope this helps! :)


Ebony van der Raaij wrote:

Olivia Beech wrote:

Hi,

I'm wondering how you trigger a click event on a button without actually clicking it. I want to be able to click on a button which will cause a different button to be clicked. I've created the button, set the 'visible' property to false.... Does anyone know where I go from here?

Thanks

You can use the runjavascript server action as said above for:

"$('#"+Button.Id+"').click();"

If you are wanting to 'click' the button but not have it displayed on the page, make sure the visible is = true and in the extended properties of the button put:

style
= "display: none;"


I hope this helps! :)


very good. This quoted procedure works correctly.

Hi Olivia Beech


You can also use the action "widget_click" 


Regards

Hi Olivia,


The easiest way is to use the widget click function that is available in the RichWidgets module:


You will need to give the button a name so you can identify the widget:


And then you call it in a screen action using the widget identification:


Be aware that this will not work on the preparation since the preparation runs before the screen is rendered, which means that when the preparation runs, the button still does not exist.


Cheers,

João