Visual Builder

Get Involved. Join the Conversation.

Topic

    James Pitman
    How to make a FireNotification dialog modal?
    Topic posted July 29, 2019 by James PitmanGreen Ribbon: 100+ Points, tagged Action Flows 
    29 Views, 4 Comments
    Title:
    How to make a FireNotification dialog modal?
    Summary:
    We have a process that submits a update to REST API. If an error returns then the Fire Notification event executes and displays, but user can navigate away from page before the message displays.
    Content:

    We have a process that submits a update to a REST API.  If an error returns then the Fire Notification event executes and displays, but the user can navigate away from page before the message displays (there is a lag from when the API returns and the Fire Notification dialog appears).  This is problematic since the user can actually navigate from the page prior to seeing the results of the REST API call.  If we replace the Fire Notification action in the Action chain with a module call to a JS function that displays an alert, then we get the desired behavior and it displays immediately at the time of the REST API return.  with this approach the user is locked on the page until the alert popup dialog is closed.  Is there a way to specify that the Fire Notification popup is modal like an alert dialog? and do you know why there would be such a noticeable delay between when the REST API returns with an error and the Fire notification event displays a dialog? 

    Version:
    19.1.3.7
    Image:

    Comment

     

    • Shay Shmeltzer

      If you look at the shell page for your app you'll see that the notifications are using oj-message component. The oj-message component that is used for notification doesn't have a modal option - so you can't switch that part.

      You can introduce into the shell your own container for messages (such as an oj-dialog with modal capabilities) - and then you can call a method to show that component from your action chains.

      How long is the delay you experience between the REST finishing and the message showing (if you look at the timing of the action in the browser's console)?

       

       

       

      • James Pitman

        Actually, it appears that the lag between the REST call finishing and the message showing is pretty small (although our alert dialog does fire before the notification even though the alert appears after the notification step).  It is the REST API call itself which takes 4.4 seconds to return this particular error.  As it stands right now, during this time the page is editable and the user can navigate away from the page before the error message is displayed.  It seems we need to lock the page until the rest REST API and message display steps are complete. 

    • Duncan Mills

      Here's the approach that I would take *should work* but let me know. 

      1. Create a modal dialog on the page and lock it down with no buttons and cancel-behavior=none to stop the user closing it manually - add your message there
      2. in the action chain, before calling the REST open the dialog using the Call Component method action to call the open() function 
      3. Do your REST stuff and any other processing 
      4. Finally call the close() method on the dialog
    • James Pitman

      Thanks for this suggestion.  This should work for our needs.