5437
Views
13
Comments
Triggering Button Click
Question
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
UserImage.jpg
Carlos Conde

Try to use the widget_click action from the rich widgets?
UserImage.jpg
Olivia Beech
I can't find this in OutSystems 8.0. Is it only in a later version?
UserImage.jpg
Carlos Conde
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.
UserImage.jpg
Olivia Beech
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!
UserImage.jpg
Tjaart Swanepoel

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.

2021-10-19 19-16-35
Ashish-S

Hi 

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

2019-11-08 16-23-42
César Mateus Conceição

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


UserImage.jpg
Ellakkiya

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();"



2018-11-30 08-20-55
Hendra

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!


2025-07-03 13-20-34
Ebony Vanderras

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! :)


2021-08-30 14-04-44
Maykon Nogueira

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.

2018-06-15 00-21-10
Pedro Vila Nova

Hi Olivia Beech


You can also use the action "widget_click" 


Regards

2018-10-29 08-31-03
João Marques
 
MVP

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.