|
| Iniciado por guest, 01,ago. 2017 14:31 - 7 respuestas |
| |
| | | |
|
| |
| Publicado el 01,agosto 2017 - 14:31 |
Hopefully a quickie for someone,
How can I close a popup page (which is a browser function) from a button whose code is server-side?
Kind Regards Reg |
| |
| |
| | | |
|
| | |
| |
| Publicado el 01,agosto 2017 - 14:49 |
Hi Reg,
if in your server code you do a pagedisplay or pagerefresh, as the borwser code who did open the popup is not executed again, your page should be redisplayed without it.
Otherwise, you can do a little dance: - create an invisible edit field - in the server code in ajax mode, write something in it - in the browser code that did the popup opening, just before opening it, start a timer - in the timer procedure, check if the something in question is there. When it is, close the popup
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 01,agosto 2017 - 16:53 |
| Ok, thanks, will give that a go Fabrice. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,agosto 2017 - 15:28 |
Hi
On a button you have browserside event onclick as well. Why not use that ?
If in Ajax mode you can try the event "from AJAX process after clicking"
regards
Allard |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,agosto 2017 - 15:35 |
Hi Allard,
I originally had it working that way, but if the data entered on the pop up was invalid in any way I couldn't find a way to keep the pop up displayed and return the user to it to correct the data because the browser code would always execute and close the pop up.
The simple solution in the end was for me to validate the data in the browser code of the button and use ReturntoCapture, that stops the server side code running. then, if all is well, the server side runs and I refresh the calling page as per Fabrice's suggestion.
Basically I just forgot to validate the data fields browser-side...
Thanks Reg |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,agosto 2017 - 15:57 |
Hi Reg,
The code is not 100 accurate but gives you an Idea. The point is you can do a popupclose() based on a condition if condition is not met then popup wil not be closed
You can do that, something like this:
VB In servercode do your check. If valid then add a value to an edt_ field that is invisible:
Server code:
if ==>Check serverside if some condition is met if true then
edt_inputfield_for _test = give some value
end
Bowser code:
If edt_inputfield_for test = null then
else popupclose(Popup_page) end
Hope this gives some insight
regards Allard |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,agosto 2017 - 16:25 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,agosto 2017 - 17:37 |
Hi Reg,
No problem. I always make sure that validation is done on server side. Browser side can be easily bypassed.
regards
Allard |
| |
| |
| | | |
|
| | | | |
| | |
|