Hi, everyone! 

Hope you're all taking care of yourselves and of yours too staying at home and washing your hands.

I need to show a web block inside a popup, and to do so, I'm trying to use popup editor.

I'm following this step by step tutorial, but it says to use OnNotify, and when I search for it, it doesn't appear. I guess this is happening because it is deprecated (I saw somewhere).

So, if it can't be used, is there another way to do so?

Another thing that I've noticed is that the PopUpEditor expects the link has a navigate method, but I can't use web screen, instead I have to use a web block. How could it be done?



Best regards,

Eduardo Coelho

Hi Edurado,

First of all, when you use method as navigate it always require Either a web-screen or External URL as destination, You cannot directly use web-block as a destination rather you have to wrap you web-block into any screen that you can select as a destination.

Also, To handle anything on notify, you have to create an action first to select it as a destination. It is not the action which is already there. 

-Sachin-

Hi Edurado,

Two way to display web block use Popup editor or Modal in Outsystems 11. For popup editor, step already mentioned by Sachin as on Notify event is already deprecated you can use Modal with new events feature and it also save one extra screen.

Now it's up to your choose and let us know if any more help needed.


Regards,

Rajat Agrawal

Hi Eduardo,

The popup actions are no longer deprecated. You can continue to use them (as I don't know any real alternative in the Web Traditional framework, the modal just doesn't cut it). 

And what you are trying to do (popup in a WebBlock) isn't strange at all and it works as expected.

From the top of my head you need to do the following;

  1. Create a webblock with a link that points to another screen
  2. Give this link a name
  3. Add the RichWidgets\Popup_editor to the block (I prefer it to place it next to the link but the location doesn't really matter) and set the LinkOrButtonWidgetId to the LinkId you created in step 1. For better visuals also give the popup_editor also a Title.

    We now have a working popup. Next step, to handle the closure of the popup;

  4. In the popup screen make sure that you have an Action the contains the following 2 widgets just before the end widget; Popup_Editor_Notify and Popup_Editor_Close.
    Like this;
  5. In the Popup_Editor_Notify you must add an argument that will be passed back to the OnNotify action of the calling screen (the one with the webblock). I normally don't want to pass anything so I set an empty string ("") here but you could also serialize an object to JSON and place that in here so the parent can do something with it.

    We now have a popup that can close itself and calls the parent of this change. We now need to handle the Notification of the popup

  6. Back to the original WebBlock select the Popup_editor widget and create an Destination Action. In this action you can then perform the actions needed to refresh your screen for example or to call some other actions to complete the action taken in the popup. You can also use the action "Deprecated_NotifyGetMessage" to retrieve the value that has been send in the popup but this is optional. An example of such action can be seen below;

I hope that this helps you. Nice alternative for the popup is the Sidebar. It doesn't have much room but it's a more modern solution for interacting with endusers.

Hi Eduardo,

Let me try to wrap up the answers for you. :)

1. You can navigate only to screens (not blocks).

2. A Popup Window (opened with a PopupEditor) must be a Web SCREEN.

3. You can create a Web Screen, add an instance of your Web Block on it, and use it as the destination for your Popup (the link to which the PopupEditor is attached has always to "navigate" to a screen).

Here an explanation. What the PopupEditor does is to create an iFrame in the actual screen (using JavaScript on the Browser), and open the OTHER screen inside it, giving you the illusion of a kind of Dialog Screen (but they are completely separate screens). It's a "visibility" thing.

4. The PopupEditor has an OnNotify event. What is required here is a Screen Action, from the screen (or block) where the PopupEditor is placed, that will be executed case you execute a Popup_Editor_Notify in the "popup screen". This way you can pass a message to the "popup screen" PARENT screen if you want.

5. As stated, you can use a Modal instead of a PopupEditor. In this case, the Block will be in the same screen as the Modal, you use the ToggleModal to show/hide the modal, and the communication between the Block and the Screen is done through events.

Hope this helps.

Cheers.

Hi, guys!

Thank you all for the replies!

The thing is:

It's a company policy that I'm following and it only allows me to use one web screen. I need to use only one web screen and "navigate" between web blocks making a logic that says wich one will be displayed depending on that choice.

The farthest I got before asking for help here was the Eduardo Jauch's item 5. Using a modal instead of a pop up editor. I've had already done this way.

The problem with this way is that it becomes "messy", because I need to open modals by clicking on buttons that are placed on every row of two table records. And the operations are almost the same, except for the parameters.

So, doing this way I have to create a modal for each operation, and it becomes repetitive too. It doesn't feel like an smart solution if I can't reuse it. However, this is what we got, so, I'll keep it.


Thank you all one more time, guys. You were very kind (:


Best regards,

Eduardo Coelho

Eduardo Coelho wrote:

The thing is:

It's a company policy that I'm following and it only allows me to use one web screen. I need to use only one web screen and "navigate" between web blocks making a logic that says wich one will be displayed depending on that choice.,

Why??????? :o

In any case, what you want is to have an Input Parameter on this screen,that allows you to chose the correct web block.

Than you put a series of IF conditions that will render the correct web block depending on the value passed.

Every time you want to show a different Web Block, you change the value in the parameter and refresh the screen. If you want to "reset" everything, you can navigate to the same screen (Current Screen), passing the correct value to show the correct block.

In the past there was a mechanism to render blocks, that would be better, I think, but I never used and I don't think it still works...

And... This will be a mess anyway. And we don't even started talking about problems with performance, viewstate, etc...

This is, like, insane :)

Cheers.

Hi, friend.

Use an event instead of a PopUpEditorNotify. You must create an OnNotify handle. Just keep it empty.


Best regards.

Eduardo Jauch wrote:

Eduardo Coelho wrote:

The thing is:

It's a company policy that I'm following and it only allows me to use one web screen. I need to use only one web screen and "navigate" between web blocks making a logic that says wich one will be displayed depending on that choice.,

Why??????? :o

In any case, what you want is to have an Input Parameter on this screen,that allows you to chose the correct web block.

Than you put a series of IF conditions that will render the correct web block depending on the value passed.

Every time you want to show a different Web Block, you change the value in the parameter and refresh the screen. If you want to "reset" everything, you can navigate to the same screen (Current Screen), passing the correct value to show the correct block.

In the past there was a mechanism to render blocks, that would be better, I think, but I never used and I don't think it still works...

And... This will be a mess anyway. And we don't even started talking about problems with performance, viewstate, etc...

This is, like, insane :)

Cheers.

Probably to bypass AO limits

Eduardo Jauch wrote:

Eduardo Coelho wrote:

The thing is:

It's a company policy that I'm following and it only allows me to use one web screen. I need to use only one web screen and "navigate" between web blocks making a logic that says wich one will be displayed depending on that choice.,

Why??????? :o

In any case, what you want is to have an Input Parameter on this screen,that allows you to chose the correct web block.

Than you put a series of IF conditions that will render the correct web block depending on the value passed.

Every time you want to show a different Web Block, you change the value in the parameter and refresh the screen. If you want to "reset" everything, you can navigate to the same screen (Current Screen), passing the correct value to show the correct block.

In the past there was a mechanism to render blocks, that would be better, I think, but I never used and I don't think it still works...

And... This will be a mess anyway. And we don't even started talking about problems with performance, viewstate, etc...

This is, like, insane :)

Cheers.


Guess it has something to do with AO prices and limits.

Thank you anyway for the fast replying!


Best regards

Eduardo Coelho wrote:

Guess it has something to do with AO prices and limits.

Thank you anyway for the fast replying!


Best regards

Insanity. So the costs that you save with OutSystems due to it's clarity, self documentation features and rapid change capabilities is totally lost just to save a few AO's here and there? What does an average AO cost? €50,- or something like that? How many hours have you already spend on trying to save this AO? 3? 4? That's at least €200 spend to save €50,-.