Skip to end of metadata
Go to start of metadata

Sample code:
Display file source:                 PUISAMPLES/QDDSSRC(GRID001D)
RPGLE source:                      PUISAMPLES/QRPGLESRC(GRID001R)

Subfiles are lists of items.  They are created using grid widgets in Profound UI.  To create a simple subfile, follow these steps:

  1. Create the grid

    Drag a new subfile grid widget on the canvas.
  2. Create columns

    You can add or remove columns by using the plus and minus icons on the right side of the grid.

  3. Size Columns

    You can resize columns by dragging the column’s vertical border from side to side.

  4. Set headings

    Double-click into each column’s heading to modify the heading text and formatting.



    Alternatively, if the subfile in your application does not need headings, set the has header property to false.
  5. Add subfile fields

    To add fields to the subfile, drag and drop other widgets into the first row of the subfile and then bind them to RPG fields.  For example, to output the Product Id, drag the Dynamic Output Field widget into the first row of the Product Id column.



    The column will be highlighted, right before you drop the element.  Once the element is dropped, it will repeat to all rows within the subfile.



    Now, bind the value property to the appropriate RPG field.  This can be done by double-clicking the widget.

    Note: In addition to output fields, most other widgets can also belong in a subfile, including action elements like buttons and hyperlinks, and input elements like checkboxes and dropdowns.
  6. Set up number of visible rows

    You can add or remove visible rows by selecting the plus and minus icons at the bottom of the grid.

  7. Control alignment

    Field alignment can be controlled through the widget’s text align property, which can be accessed in the Properties Window once the widget is selected or by using the Formatting section of the Edit toolbar in the Ribbon.  For output fields, you must ensure that the element has a predefined width.  This can be accomplished by resizing the element horizontally or setting the width property manually in the Properties Window.
  8. Setting the clear subfile indicator

    The grid component contains a number of properties that allow you to control it through server-side RPG coding.  One critical property is clear subfile, the equivalent of the CLRSFL keyword from traditional green-screen programming.  It is conventional to clear the subfile before loading it with data.  To accomplish this, bind the clear subfile property to an indicator field.  Then, in your RPG code, set the indicator and write the subfile control record to clear the subfile.
  9. Setting record format names

    Before utilizing the grid in your RPG code, you must set record format names for the subfile and for the screen that contains the subfile, which is referred to as the subfile control record.

    To set the subfile record format, select the grid, and modify its record format name property.

    To set the subfile control record format, click the canvas to select screen properties, and then set the record format name property.

    These changes will be reflected in the Record Format List in the top right area of the visual designer.
  10. Writing the RPG

    The RPG code to load the subfile with data may look as follows:

  11. Equivalent PHP code would look as follows:
Labels
  • No labels