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

Call RPG after shown a Widget

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

  • Call RPG after shown a Widget

    I have an app that opens a detail view on click of a table row ( Hide/Show widgets ). On this detail view is a form which should always fetch values from the database. I have already tried it with gMode = 'formRender'; in a helper program, but it only calls the helper program with the first click on a record, with all further clicks it does nothing.
    Does anyone have any ideas?

    Thanks in advance.

  • #2
    Why not use "Filter Widget" on the row click? Then the form will automatically pull the data for the selected row and there is no need for a helper program.

    Comment


    • #3
      If the detail view is empty I want to create a new data set, for this I have to get the ID via SQL

      Comment


      • #4
        Do you write out the new record to the database or just set the values in the form? In the case of an empty detail view are you generating an entirely new unique ID? Or is the ID related to the row that was clicked?

        Comment


        • #5
          an entirely new unique ID.

          Comment


          • #6
            OK, so then I assume that you would be writing out a new record. I would suggest the following:
            • Create a new app variable to hold the id associated with your form. For this example, I will refer to it as "formId".
            • Add a new action to the row click of your table/grid: Call RPG Program
              • You will need to create a new EXNABBTN based RPG program for this. This program will set the value of your "formId" app variable and write out the new DB record.
                • SetResponse('appVar':'formId':SOME_VALUE);
                • SetResponse('success':'true');
              • Add a Filter Widget action under the "success=true" portion of the Call RPG Program action
                • Use the "formId" app variable as the key to filter the widget

            Comment


            • #7
              Thanks for the help, this solution worked! :-)

              Comment

              Working...
              X