Hi everyone!
I need to solve one problem: I have an webpage that I need to open when I press the "save button" in the form, but I want it to open in pop-up (In other situation that webpage opens like pop-up, with the link and pop-up editor).
Somebody can help me please?
Thank's to all!
Best regards,
Ricardo Pereira
Hi Ricardo.
If your save button is calling a Screen Action (I suspect), than you have to use a small trick.From the screen action, before finish it, execute a "RunJavaScript".
The JavaScript code will "click" in a "hidden" button/link (with the CSS display: none set), and this hidden button/link you link to the PopUpEditor. It can be as simple as this: "$('#"+OpenPopUp.Id+"').click();", where OpenPopUp.Id is the id of the hidden button/link.
I think this is the only (or at least the easiest way) of doing this.
Cheers,
Eduardo Jauch
Eduardo Jauch wrote:
Eduardo you are the best :)
Thanks!
But where I execute "RunJavaScript"? In Screen Action I don't have any widget for that...
Thank's again for your help!
It is in an eSpace named HTTPRequestHandler. You have to go to Dependence Management and add a reference to this Action.
Cheers, Eduardo Jauch
Ok it's working! Just one problem: It opens the popup but close automatically and go to the end of the screen Action! Can I control this?
Thank you very much! ;)
Hello Ricardo.
Probably your button is set to "Submit". It must be "Ajax Submit", or your page will be refreshed and the popup will disappear.
Here is an example and the OML is attached.
Cheers,Eduardo JauchP.S: Remember to mark one answer as the correct, in order to allow other users searching the forum to easily find the answers to the same questions. ;)
Very good solution Eduardo !! Thanks a lot. With works with me also
Hi,
Eduardo you have given very good solution, same thing I am doing in many of my projects.
Thanks! I'll try that now!
Hi Ricardo,
Let us know if it worked :)
Cheers,Eduardo Jauch
No, it didn't work. :(
In the save action he runs getJavaScript and jump out for the next step and finish that workflow, closing the pop-up automatically. The botton already have the Ajax Submit selected.
Can you help me a little bit more please?
Thank's!
Ricardo,
What do you have "different" from the OML I sent?Do you actually see the PopUp open before it closes?
Because in this case, the problem is in the PopUp.Do you have a "PopUp_Close" action in the preparation?There is any log error, in Service Center?
EDIT. Just a small question... Are you trying to open a PopUp from another PopUp? Do you have a PopUp_Close action in the Save button?
If you are trying to open a PopUp from another one, I'll advise against it. Strongly...
Instead, in the Save button logic, send a Notification message to the parent screen, and in the OnNotify on the parent, open a NEW PopUp window, using the approach I use in the OML I sent.
And... The Page you are trying to open...It has a PopUp Layout, right?
It's not any error in Service Center and I don't have any close popup action in the flow. I run in debugger mode and it just pass there and jump for the next step...I don't understand.
Yes, this page have a popup layout and I'm trying to open it from a regular webpage, not a popup.
It's strange but it seems that the flow ignores what is inside runJavaScript...
It doens't ignore it.
The RunJavaScript will run only in the Browser. When you call this function, what you are telling is that you want to send back the javascript together with the answer to the Browser. It will be executed there.
To this to work, the last element in the flow must be an end point. If you are navigating away of the page, the javascript will not work...
Ah, ok! It' wasn't with the End Point!
It's working just fine! Thank you very much for your help!
Ah!
Nice. Glad we were able to help! :)
Hello, i have a question about that solution, and why i think that is not the best solution... On your browser you have dev tools. User have the same tools too. He can just uncheck hidden tick inn css and he will see the button...
So my question is, ther is some other way to run popup after some conditions?
Hello Jordan,
This trick is not meant to be "safe". There is no security client side.
Of course, you can create the hidden button dynamically before executing the JavaScript, in the same action, sending it to the html changing an IF widget condition.
Doesn't matter. The Popup still needs to validate that it was open correctly.
This is just a "cosmetic" thing.
And I don't think there is any way to open a popup in a secure way, once a popup is just a page that is open in an iframe. If I want, I just open the html, look at the URL and open it in a tab.
Cheers
Hi!
I have a question here. In a scenario, I need to open a reactive based web page in a popup. The original screen is made in Traditional Web. On the original Traditional Web page, there is a button. On click of that button, I need to open a Web page made with reactive inside the popup. For that I was using the External URL feature. But it turns out that the page is just loading inside the popup but it is not opening.
Any idea why this is happening?