• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Closing an app within URL Utility Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Closing an app within URL Utility Widget

    Not sure if my set up is incorrect as I'm starting to use the URL utility widget more....

    I have a main app A that calls an app B and launches it in a new section that has a URL utility widget that contains the app.

    I was under the impression that on every call to app B, my app would launch as if its the first time its being called (call startup pgm).

    Especially if App B has a (back) button that closes app B along with firing a public event 'GoBack' that app A listens for. That 'GoBack' event in App A then shows the previous (main) section.

    The functionality works fine one the first launch.. but on the next attempts to launch app B, my 'startup' program is no longer triggered in app B because it seems to not close. All the data from the first launch stays.


    Sure I can set up public events to be fired back and forth. I've got some event listeners set up but it would seem a bit tedious as a long term solution. App B will be called from other calling apps and I simply want to pass 1 or 2 parameters. App B takes those parameters at startup and performs accordingly.

    What should closing app B do?
    Last edited by mramos; 07-09-2024, 04:51 PM.

  • #2
    It seems like NAB's built-in URL utility widget feature doesn't close/reopen apps properly.

    Startup behaviors should run at startup regardless of if the app exits standalone or if it just exists within a url utility widget.

    I'd like to see this addressed in a new Valence update too!

    Comment


    • #3
      It's working as intended. We don't want to reload the application if it's the same application because then the user will have to wait each time for all resources to load. That would result in a poor user experience.

      Normally, you would pass some parameters to the application, for example, "withinApp," and probably trigger an event.

      This way, the application will know what to do if it's not running standalone. An application designed to run within another app would be designed differently than an application that is always run standalone.

      If you want to force it to always reload, you can run the following "Execute Script" before showing the app within the URL Widget. I've named the URL Widget "myUrlWidget":

      Code:
      const urlWidget = getWidget('myUrlWidget');
      
      // force the url widget to reload the app
      //
      urlWidget.setAppId(null);
      
      success();

      I will also add a feature request to include a setting to force the URL Widget to reload, though this wouldn't be the default behavior.

      Comment


      • #4
        Thanks for clarifying. Making it optional in the future will be great.

        Comment

        Working...
        X