Deprecated NotifyGetMessage: example of an alternative?

Hi, I'm using a popup to find movies using the OMBd API, and when found, I return the OMDb Id using Popup_Editor_Notify. In the parent screen I use NotifyGetMessage to retrieve the returned Id and start using it.
The function seems to be deprecated, and the usage of a Web Block and Events seems to replace the functionality I've built. Is there an example using Web blocks/Events in combination with a popup screen?

Hi Charles Betman,

You can continue to use the same action which is deprecated, but notice that P11 has a new way of notify parent web block by events. 

Maybe you want to see this post: https://wwwlb.outsystems.com/forums/discussion/42797/cannot-find-notify-action-under-logicgtgtsystem/

Regards,

I'll have a look at it Marco, thanks.

Marco Arede wrote:

Hi Charles Betman,

You can continue to use the same action which is deprecated, but notice that P11 has a new way of notify parent web block by events. 

Maybe you want to see this post: https://wwwlb.outsystems.com/forums/discussion/42797/cannot-find-notify-action-under-logicgtgtsystem/

Regards,

Hi Marco, this is what I found a few posts deeper:

"Hi Loic, For popups you still need to use Deprecated_Notify and Deprecated_NotifyGetMessage . This was something that Outsystems overlook and I hope they fix it in later releases.

Regards, Marcelo Ferreira" ... https://www.outsystems.com/forums/discussion/41012/how-communication-between-widget-and-parent-page-works-on-outsystems-11/#Post147741


So, for popups (as I'm using) Events cannot be used in stead of OnNotify yet.

Solution

Hello Charles,

I've been using the Modal with Web Block to replace the Popup, in OutSystems 11. IT was greatly improved, as you can now have more than one on the screen and open/close them using their names, and you can put them in the middle of the screen, like the Popup.

This way any event triggered by a block in the Modal will be captured in the page itself. 

Cheers.

Solution

Ah thanks Eduardo. Sounds good, something I'll have to dive into ... 

Charles Betman wrote:

Ah thanks Eduardo. Sounds good, something I'll have to dive into ... 

Looked into it, and almost got it working :-)

Replaced the Popup with a modal and a Web block. When selecting a movie in the web block, an event is raised that triggers an event handler in the parent block (the IMDb Id is transported to the parent).

The IMDb Id is processed, movie content is collected using the OMDb API, the form input fields are filled and the form is refreshed. All the data is displayed as expected, but an Exception occurs: "An exception occurred in the client script. Error: Cannot read property 'contains' of undefined". The field IMDB is required.

First of all, the IMDB id is presented correctly, and second, I didn't expect the form to be checked because the Save button hasn't been pressed.

When I now click on the Save button, the new movie is correctly saved without any errors.

So, why does the processing of the event ends with this exception? Hope anyone can help me out with this one ...



Hello Charles,

This is a problem in JavaScript.
When you refresh your page, something is not right and you are trying to access an element that probably does not exist or had the ID changed (because of the refresh), while the code was still looking for the component with the old ID.

Just my 2 cents.

EDIT: If you can provide your application for us to inspect, we can try to help you find the problem.

EDIT 2: I don't know why the form is being checked...

EDIT 3: I can reproduce the form validation on Ajax of the form in an Event Handler. I already inquired OutSystems about it. But the JavaScript error seems to be something specific to your page, as I don't have this problem.

About the invalid input:

I found it (with help of @Kilian)

Are you selecting in the block with a button? If it has validation set (probably server), even if it is inside a block, it will validate the form in the page.

And as the Handler was not executed yet, the valid is set to false.

Later, in the handler, the form receives the info, but now the valid is set already to false and the refresh just shows the input as invalid.

Eduardo Jauch wrote:

About the invalid input:

I found it (with help of @Kilian)

Are you selecting in the block with a button? If it has validation set (probably server), even if it is inside a block, it will validate the form in the page.

And as the Handler was not executed yet, the valid is set to false.

Later, in the handler, the form receives the info, but now the valid is set already to false and the refresh just shows the input as invalid.

Thanks for looking deeper into it Eduardo (and Kilian as well of course)!

I removed the validation (Server) from the button I use to select a specific movie, and yes, the field IMDB no longer is marked as invalid.

I've included the OML as you asked for the exception.(FilmNieuw is a duplicate of FilmDetail, in which I replaced the usage of a popup/notify with a modal/web block/event).


 


I solved the exception above.

What I initially did was closing the modal (using ToggleModal) in an action within the modal / webblock itself.
I moved that part to the eventhandling action in the parent screen and no exeption anymore. As simple as that :-)