ComboBox

Previous Next

 

A drop-down list box in a dialog window. The user can expand the list and then choose one of the options listed.

 

Syntax

<ComboBox
  name="name-literal"
  select="xpath >> node-set"
  firstitem="string"
</ComboBox>

The required select attribute is an XPath expression that identifies a node set. This node set must evaluate to a collection of strings. These strings populate the drop-down list that the user chooses from.

The optional firstitem attribute is a string shown as the value of the ComboBox before the user has made a choice.

Example

This example reports what option the user chose from the list. The value selected by the user is assigned to the ComboBox element as its string value.

<example xmlns:pc="Processing.Command" xmlns:valuedialog="Dialog.Result" xmlns:assign="Processing.Command.Assign" pc:hideme="true">
  <pc:Dialog 
    valuedialog:rdbmsvalue="/Forms/Form/ComboBox[@name='rdbmsvalue']/text()" >
    <Form w="700" h="200">
      <Title>ComboBox example</Title>
      <Label dx="10" dy="20">Please choose from the dropdown list and then press OK.</Label>      
      <Label newline="yes" dx="10" dy="20">RDBMS</Label>
      <ComboBox w="150" name="rdbmsvalue"  firstitem="Choose..." select="rdbms/value"  >
        <rdbms><value>oracle</value><value>sqlserver</value></rdbms>
      </ComboBox>
      <Button dx="10" dy="20" newline="true"><Result>OK</Result>OK</Button>
      <Button><Result>Cancel</Result>Cancel</Button>
    </Form>
  </pc:Dialog>
  <pc:terminate test="$valuedialog:rdbmsvalue='Choose...'" msg="Error: RDBMS must be specified."/>
  <pc:value-of select="concat( 'RDBMS = ', $valuedialog:rdbmsvalue)"/>
</example>

 

See also

pc:Dialog