Button to open PopUp

Button to open PopUp

  
Hello.

I wander if it is possible, in the style guide 4.2, to call a popup from a button.
I only see calling popups from links and I tryed to call it from a button but it always opens in the same page, not in a popup (with both methods, Submit and Ajax).

Thanks in advance.
Hi Alexandre,

Although it is still not possible to use a button to open popups directly there is a workaround:

1 - You will need a link on your page (set it's style to Invisible, but keep the Visible property True)

2 - In the button create an extended property onclick =
"document.getElementById('" + HiddenLink.Id + "').click(); return false;"

Cheers,
Tiago Simões
Hi Tiago.

Thank you for your answer.

The idea is ok, and I have tryed already. Unfortently the click() event doesn't exist in the link, so it doesn't work.
Do you know any other work around?

Thank you.
Hi Alexandre,

You are right my code snippet does not work.
You can do another thing, let the button go to an action (with Method=Ajax) and use there the RichWidget's Widget_Click() action to click on the link.

Let me know if that helps.
Cheers,
Tiago Simõe
Hi Tiago.

Thaks again for your answer.
Once again I tryed your code but unfortently it doesn't work. Like the previous option it opens in the same window, instead of in a popup.

Don't know how to solve it.

Thanks.
I tested the second method and worked perfectly to me
hi,

View this sample, hope it will help





Best regards
Daniel Maia

Hello

In Outsystems 8 is it already possible to use a button to open popups directly? Or should I still use this workaround?

Thank you

Best regards
Hi Pedro,

You can use a button with RichWidgets popup editor.
Hi André

So if understand correctly, now it's possible to use the button directly in RichWidget PopUp Editor. There's no need to use an invisible link and WidgetClick (in RichWidgets) as a workaround.

Thank you
Yes Pedro, that's it.

The method for the button or the link must be navigate.

What about if you require some ACTION elements to run before you open your Popup?
I have an autocomplete that I need to retrieve a value from before I open the Popup control - would really prefer to fire all of the above from one 'select' button.