Force a webpage to open in Pop-up

Force a webpage to open in Pop-up

  

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

Solution

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

Solution

Thanks!


But where I execute "RunJavaScript"? In Screen Action I don't have any widget for that...


Thank's again for your help!

Hi Ricardo.

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 Jauch

P.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?

Cheers,
Eduardo Jauch 

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.

Cheers,
Eduardo Jauch

And... The Page you are trying to open...
It has a PopUp Layout, right?

Cheers,
Eduardo Jauch

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...

Hi Ricardo,

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...

Cheers,
Eduardo Jauch

Ah, ok! It' wasn't with the End Point!

It's working just fine! Thank you very much for your help!


Cheers,

Ricardo Pereira

Ah!

Nice. Glad we were able to help! :)

Cheers,
Eduardo Jauch