Step 6. Create a Messages Pop-Up

The Server Module's srvroutine, is invoking the employee table's OAM to insert an employee record, and the OAM is performing validation checks. Currently the web page is not handling any messages which are returned.

In this step, you will create a Pop_up component to handle these messages. When a srvroutine is invoked from a web page, the server module returns any validation error messages to your web page as a collection in the component Sys_MsgQ.messages.

1.  Create a New / Reusable Part / New Pop-Up Panel:

     Name: iiiMessagesPopUp

     Description: Messages Pop-Up

     Target Platform: Web Browser.

2.  On the Design tab, Select the Details tab and change pop-up's Caption to Messages

3.  Add a List control. The List control will be named List1.

a.  Using the Layout ribbon, change Size to Fit Both.

b.  This will also add a 1 x 1 table layout to the panel.

4.  Select the List and on the Details tab:

a.  Change ColumnHeaderHeight to 0

b.  Change ColumnLines to False

c.  Change RowLines to False

5.  Locate the field STD_QSEL on the Repository tab and drag and drop it into the List control. This is a 256 long, alphanumeric field.

    This will create a column with the name ColumnSTD_QSEL1.

a.  Change ColumnUnits to Proportion

b.  Change ColumnWidth to 1

6.  Save your Pop-Up component.

7.  Select the Source tab. Create a new method routine name Show.

     When the Show method is invoked by the web page, this routine will:

Clear the List1 control

Process the collection Sys_MsgQ.Messages in a FOR/ENDFOR loop

For each Message in Sys_MsgQ, assign Message.Text to STD_QSEL

Add an entry to List1.

Invoke the ShowPopUp method with a transition of FadeInAndScale.

Your code should look like the following:

Mthroutine Name(Show)

Clr_List Named(#List1)

For Each(#Message) In(#sys_msgq.Messages)

#Std_Qsel := #Message.Text

Add_Entry To_List(#List1)

Endfor

#Com_owner.ShowPopup Transition(FadeInAndScale)

Endroutine

 

8.  Compile the Pop-Up component.