Button

Previous Next

 

A push button. When the runtime user presses the button, the dialog is closed.

 

Syntax

<Button><Result>result-value</Result>prompt</Button>

prompt is the text displayed on the button.

When the dialog runs, result-value is assigned to the result attribute of the Form element in the dialog's embedded XML. This makes it possible to use result-value to test whether the runtime user pressed the button (or, in a button group, WHICH button the user pressed). The Example demonstrates this.

Example

<example xmlns:pc="Processing.Command" xmlns:valuedialog="Dialog.Result" xmlns:assign="Processing.Command.Assign" pc:hideme="true">
  <pc:assign-default
   valuedialog:title="Button example"
   valuedialog:textlabel = "Please press Proceed or Cancel." />
  <pc:Dialog 
    valuedialog:ok="Forms/Form/@result='OK'" >
    <Form w="700" h="200">
       <Title><pc:value-of select="$valuedialog:title"/></Title>
       <Label dx="10" dy="20"><pc:value-of select="$valuedialog:textlabel"/></Label>
       <Button dx="10" dy="20" newline="true"><Result>OK</Result>Proceed</Button>
       <Button><Result>Cancel</Result>Cancel</Button>
    </Form>
  </pc:Dialog>
  <pc:if-then test="$valuedialog:ok"><pc:value-of select="'User pressed Proceed.'"/></pc:if-then>
</example>

 

See also

Result

pc:Dialog