Skip to content

Declaring Prompt Lists

Normally, a lookup list will consist of a modal panel parent (dbModalPanel), a child DataDictionary server object (DDO), a child prompt list grid (cDbCJGridPromptList), and some child buttons. The prompt list object will, in turn, contain one or more column objects (cDbCJGridColumn).

Below is an example of a typical lookup list:

Object Customer_sl is a dbModalPanel
    Set Border_Style to Border_Thick
    Set Minimize_Icon to False
    Set Label to "Customer List"
    Set Size to 134 238

    Object Customer_DD is a Customer_DataDictionary
    End_Object

    Set Main_DD to Customer_DD
    Set Server to Customer_DD

    Object oSelList is a cDbCJGridPromptList
        Set Size to 106 227
        Set Location to 6 6
        Set peAnchors to anAll

        Object oCustomerNumber is a cDbCJGridColumn
            Entry_Item Customer.Customer_Number
            Set psCaption to "Number"
            Set piWidth to 50
        End_Object

        Object oCustomerName is a cDbCJGridColumn
            Entry_Item Customer.Name
            Set psCaption to "Customer Name"
            Set piWidth to 100
        End_Object
    End_Object

    Object oOK_bn is a Button
        Set Label to "&Ok"
        Set Location to 116 77
        Set peAnchors to anBottomRight

        Procedure OnClick
            Send OK To oSelList
        End_Procedure
    End_Object // oOK_bn

    Object oCancel_bn is a Button
        Set Label to "&Cancel"
        Set Location to 116 130
        Set peAnchors to anBottomRight

        Procedure OnClick
            Send Cancel To oSelList
        End_Procedure
    End_Object // oCancel_bn

    Object oSearch_bn is a Button
        Set Label to "&Search..."
        Set Location to 116 183
        Set peAnchors to anBottomRight

        Procedure OnClick
            Send Search To oSelList
        End_Procedure
    End_Object // oSearch_bn

    On_Key Key_Alt+Key_O Send KeyAction To oOK_bn
    On_Key Key_Alt+Key_C Send KeyAction To oCancel_bn
    On_Key Key_Alt+Key_S Send KeyAction to oSearch_bn
End_Object

In the Studio, you would create a lookup list by running the "Lookup Wizard" from the Studio's Create New dialog. This wizard will create the above object structure and automatically associate the prompt list with selected columns in the main table's DataDictionary class by setting the table column's Field_Prompt_Object properties.

The Studio's Data Dictionary Modeler can be used to associate further columns with the prompt list.

See Also