fm:if, fm:then, fm:else, fm:else-if

Traditional 3GL branching logic. Try to keep usage to a minimum.

SYNTAX

<fm:if test="xpath">
  <fm:then>
fox presentation commands and xhtml or fox action commands
  </fm:then>
  <fm:else-if test="xpath">
fox presentation commands and xhtml or fox action commands
  </fm:else-if>
  <fm:else-if test="xpath">
fox presentation commands and xhtml or fox action commands
  </fm:else-if>
  <fm:else>
fox presentation commands and xhtml or fox action commands
  </fm:else>
</fm:if>

CONCEPTS

EXAMPLES

  1. Use in presentation section at state level, using original ORDERMODULE.

<fm:if test="/*/ORDER/ORDER_ITEM_LIST/ORDER_ITEM">
  <fm:then>
There is at least one outstanging order to be processed.
  </fm:then>
  <fm:else>
There are no outstanding orders.
  </fm:else>
</fm:if>

  1. Use in action section, using your copy of ORDERMODULE with phantoms.

<fm:if test=":{action}/QTY>5">
  <fm:then>
    <fm:alert message="string(concat('Item quantity is: ', :{action}/QTY))"/>
  </fm:then>
  <fm:else>
  <fm:alert message="Quantity is less than 5"/>
  </fm:else>
</fm:if>