Skip to end of metadata
Go to start of metadata

Sample code:
Display file source:                PUISAMPLES/QDDSSRC(CUSTINQ1D)
RPGLE source:                     PUISAMPLES/QRPGLESRC(CUSTINQ1R)

In this example, we will create a simple application that asks for a customer number and displays the corresponding customer name.

  1. Create a panel
    1. Drag the Simple Panel widget onto the Canvas
    2. Double-click to initiate inline editing, and type “Customer Inquiry”
    3. Resize the panel

      Note: Once the panel is positioned, you may choose to lock the panel by right-clicking it and selecting the Lock in Place option. When a panel is locked, you can select other elements within the panel without inadvertently moving or sizing the panel itself.  To move or resize a locked panel, you must first unlock it from the right-click menu. 
  2. Create customer number label
    1. Drag a Label into the panel
    2. Double-click and type “Customer Number:”
  3. Create customer number textbox
    1. Drag a Textbox into the panel and place it next to the customer number label
    2. Double-click to initiate the binding dialog for the value property of the textbox
    3. Specify field name and type.  For example:
      1. Field Name: CSNUM
      2. Data Type: Decimal
      3. Length: 7
      4. Decimals: 0
  4. Create customer name label
    1. Drag a Label into the panel
    2. Double-click and type “Customer Name:”
  5. Create customer name output field
    1. Drag a Dynamic Output Field into the panel and place it next to the customer name label
    2. Double-click to bind the field’s value
    3. Specify field name and type. For example:
      1. Field Name:  CSNAME
      2. Data Type: Character
      3. Length: 30
  6. Add a Find Customer button
    1. Drag a button into the panel
    2. Double-click and type “Find Customer”
    3. Resize the button to make the text fit
    4. Bind the response property to an indicator named btnSubmit
    5. Select “Enter” for the shortcut key property
  7. Add an Exit button
    1. Drag a button into the panel
    2. Double-click and type “Exit”
    3. Bind the response property to an indicator named btnExit
  8. Set record format name
    1. Click the canvas to select screen properties
    2. Type “CUSTINQFMT” into the record format name property
    3. Type “Customer Inquiry” into the description and document title properties
  9. Save the Display File.  Name it “CUSTINQD”.

    Your screen design should look similar to the following:

  10. Next, create the RPG program.  Call it “CUSTINQR”.  The code will look similar to the following:

  11. Depending on your environment, you may have to add the HANDLER(‘PROFOUNDUI(HANDLER)’) keyword to the display file declaration, use ExtFile() to qualify file names, and/or create a starting CL program.

    For more details, see Creating a Hello World RPG Program and Configuring the RPG Compiler sections of this guide.

    Note: Database file CUSTMASTP with sample records can be found in library PUISAMPLES, which ships with Profound UI.
  12. Equivalent PHP code would look as follows:
Labels
  • No labels