Altova MobileTogether Designer

The two combo boxes at the top of the page are used to accept end user selections and to display data based on these selections. The screenshot below shows the combo boxes when the solution is run; the tabular report below the combo boxes is based on the combo box selections.

MTDDBCSimulatorComboBoxes01

The next screenshot shows the combo boxes in the design. The combo boxes have been placed in separate cells of a table for layout purposes.

MTDDBCComboBoxes01

 

The DesiredOffice combo box

The following settings have been made:

 

A source node link is made between the combo box and the $XML1/root/@DesiredOffice node by dragging the node onto the combo box. This serves to pass the combo box selection to the node and the value of the node to the combo box.

 

The items in the dropdown list of the combo box are defined in the Edit Combo Box dialog (screenshot below), which is accessed via the Additional Dialog button of the Combo Box Entry Values property (in the Styles & Properties Pane).

MTDDBCComboBoxes02

Notice that the values in the dropdown list are taken from the $DB1/DB/RowSet/Row/@City node (that is, the names of the cities). But the value that goes into the $XML1/root/@DesiredOffice node (because of the source node link) is taken from the $DB1/DB/RowSet/Row/@id node. Since the Sort Values check box has been selected the items of the dropdown list will be sorted.

 

An UpdateNode action has been set for the OnFinishEditing event. Right-click the combo box and select Control Actions for OnFinishEditing to display the action definition. The node to be updated is root/@DesiredYear. The update value is provided by an XPath expression: min(distinct-values($DB2/DB/RowSet/Row[@Office=$XML1/root/@DesiredOffice]/@Year)). This expression selects all the records of the office selected in the combo box, then collects the unique years from these records, and finally selects the year with the minimum numerical value.
 
MTDDBCSimulatorComboBoxes01
 
So, when Vienna is selected in the first combo box (as in the screenshot above), all the records in $DB2 with @Office='Vienna' were searched and a sequence of the unique years in these records was created. The year with the minimum numerical value—in this case 2010—is passed to the node to be updated—in this case $XML1/root/@DesiredOffice. Since this node is the source node of the second combo box (the @DesiredYear combo box), this combo box now displays the minimum year value—in this case, 2010.

 

The DesiredYear combo box

The following settings have been made:

 

A source node link is made between the combo box and the $XML1/root/@DesiredYear node by dragging the node onto the combo box. This serves to pass the combo box selection to the node and the value of the node to the combo box.

The items in the dropdown list of the combo box are defined in the Edit Combo Box dialog (screenshot below), which is accessed via the Additional Dialog button of the Combo Box Entry Values property (in the Styles & Properties Pane).

MTDDBCComboBoxes03

Notice that both the values in the dropdown list as well as those that will be passed to the XML node are the same. They are the sequence of all the unique years in which the selected office has recorded sales. Since the Sort Values check box has been selected the items of the dropdown list will be sorted.

 

© 2018-2024 Altova GmbH