Dialog Box Updating

I am trying to write a dxl that takes the menu Filter option and have it search multiple modules.  The question I have is how the current menu Filter dxl performs the update of the Value field based on the selection of the Attribute field (for example, if the Attribute field is set to an attribute that has enumerated options, these options show up in the Value field as a drop down list.  If the Attribute field is then changed to 'Object Text', which is a text field, the Value field changes to a text field).  How is this done?.  Is there a dxl command, like a trigger, that allows the Value field to be changed based on what is the value in the Attribute field?

 

Thanks in advance for any help in this area.

 

Of course, if there is a dxl that already exists that does this, this would be easier to use....


Mike.P.Adams - Mon Nov 05 14:46:42 EST 2018

Re: Dialog Box Updating
PekkaMakinen - Tue Nov 06 00:45:20 EST 2018

Some earlier discussion on similar function https://www.ibm.com/developerworks/community/forums/html/topic?id=9e7e9dd8-cc52-43b7-a993-ce9e34e71239

For the dialog box update, there are methods to set a callback to a dialog box element (DBE) so that a change allows you to change other values or DBEs. Look in the DXL Reference for the set function (there are many "set"s, but this specific form):

 

set(select)

Declaration
void set(DBE 
element, void 
select(DBE)) 

Operation

Attaches a callback to any dialog box element other than a list view. The callback must be of the form:

void 
select(DBE option){
} 

which fires when option changes.

The exact semantics vary depending on the type of element, but in principle it means a single click. For field elements, the callback only fires when the user clicks Return or Enter with the cursor in the field.

If this function is used with a list view, a DXL run-time error occurs.

Example

This example adds a callback to a radio box.

DB boatBox = create "Craft"  

string boats[] = {"Dinghy", "Destroyer",
                    "Carrier", "Mine sweeper"} 

DBE boatCheck = radioBox(boatBox, "Select
                  class:", boats, 3) 

void toBuild(DBE option) {
    int favorite = get option 

    ack(boatBox, "You are planning a new "
                    boats[favorite] "?")
} // toBuild 

set(boatCheck, toBuild) 

show boatBox