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

Popup widget behavior

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

  • Popup widget behavior

    Hello again,
    My current app uses a button helper program to set some app vars and then on success=true, it then filters a popup form widget with those values. The popup appears, with the correct results, my form helper runs and at the end, fires an event. This event launches a URL that the form helper set as a app var, then closes the popup.
    That part works exactly the way I want. I run into an issue when trying to repeat this process.
    I have another button helper program that then resets app vars, and when it's done, I filter the same widget with auto-show checked. This is where it gets stuck. The widget shows on the screen but it never loads any data or kicks off the form helper program.
    Is there some issue with using a popup multiple times in the same app? How do I get the popup to load data again and run the form helper program?
    Thanks,

  • #2
    So it's filtering a popup form widget, form helper runs and launches a URL and then closes the popup?.. So the user never interacts with the popup?

    We will need try to replicate this on our end because you can reshow popups over and over again however we need to completely understand your setup so we can replicate

    Thanks

    Comment


    • #3
      Ya, I know it sounds weird but it's where I have ended up with this app. The widget is built on a remote database from a content management system we use. I filter the widget with 2 values because one of the fields in the widget is a primary key to a document in our content management system. So when that widget is filtered, I grab this PK value in the form helper, then create a URL (app var) with this key. then I fire an event that launches the URL and closes the form widget. I don't have a need for the user to interact with this widget. I use it only to create a unique URL and assign the URL to an app var to then launch the site.
      I'm working on getting a remote database connection set up on the IBM so I don't have to do it this way. I would rather create the URL with an RPG program because that seems like a better idea than what I'm doing now. I thought I could get it working with NAB but I keep running into limitations.

      Comment


      • #4
        I would suggest the RPG button program get the needed information to construct the URL and just return it.

        Just a thought but you could create a web service over VVDATASRC and call it from within the RPG button pgm to get the columns you need to construct the URL then just return the URL

        You can create the web service from Portal Admin > Web Services

        Example SQL statement:
        Code:
        SELECT
          *
        FROM
          json_table(
            systools.httpgetclob(
              'http://IBMI:7061/service/yourWebService?key=YOURWEBSERVICEKEY&action=getData&VVID=YOURDATASOURCEID&limit=1&skipCount=1&addFilter=(F1.TRATSCode=N%27STRETCH%20WRAPPER%20%27%20AND%20F1.Division=N%2768%27)',
              NULL
            ),
            '$' columns(trantsCode varchar(100) path '$.DSROOT.F1_TRATSCode')
          )
        I believe instead of manually encoding db2 has a urlencode helper

        Comment


        • #5
          Ok, that could work. I'll give it a try. Thanks.

          Comment


          • #6
            That worked, thank Johnny. Question about the parms, how did you know which parms to send? Is there any documentation on calling Web Services created in Valence?

            Comment


            • #7
              Great, it's sole purpose is to be called directly from App Builder/NAB App front-end so we don't have any documentation on calling it. Never had a request/use case for it to be called outside of NAB

              I'll talk to the team about possibly having documentation on calling it via web services

              Comment


              • #8
                Honestly, my use case works well because what you have provided is a way for me to query my MS SQL database in RPG without having to go through some other configurations. I see how it's kinda pointless when most data sources are files in DB2 which are easily queried with RPG.
                When I started researching how to query MS SQL from RPG, I was finding that I needed to do a bunch of stuff that involved my DBA making changes to the MS SQL instance. This is a great workaround for us.

                Comment

                Working...
                X