Creating or configuring forms > Adding an integer decider

6.6 Adding an integer decider

Whenever the XML allows an integer decider (instead of a concrete integer), these are the valid options:

To add an integer decider

  1. Locate the UI component that holds an integer (such as a number spinner). Determine which operation to use.
  2. Configure a binary operation.
    1. Set the <calculate> element with the binary-operation attribute set to the operation to be performed ("add" or "multiply").
    2. Set the <first> and <second> elements to components, integers, etc. These themselves could be deciders.
    3. <calculate binary-operation="add">
        <first>
          <component id="disk" />
        </first>
        <second>60</second>
      </calculate>
      

      60 is added to the "disk" component. If the binary-operation were "multiply", the result would be the product of 60 and "disk".

  3. Configure other operations.
    1. Set the <calculate> element with the operation attribute set to "string-to-int".
    2. Set a child string decider for Viewpoint to evaluate and parse into an integer. See Adding a string decider.

Related topics