Expr (attribute of disabledcondition)

From JRapid

Jump to: navigation, search

The expr attribute is used inside a conditional element to specify an EL expression that evaluates and returns true or false.

Usage

<property> 
             <disabledcondition expr="EL">
                [ Content: param*]
            </disabledcondition>
</property>

Example

In the following example we have an entity Employee to save the information of the employees and WorkingUnit that is made of a leader and a group of employees. The leader of the working unit may decide he/she wants assistance to manage the working unit. If this is the case, then when creating a new working unit assistant field will be disabled.

<entity name="Employee" label="Employee">
  <property name="firstName" label="First name" display="primary" />
  <property name="lastName" label="Last name"/>
  <property name="wantsAssistance" label="Wants assistance" type="boolean" />
</entity>
<entity name="WorkingUnit" label="Working Unit">
  <property name="leader" label="Leader" entity="Employee"/>
  <property name="assistant" label="Assistant" entity="Employee">
    <disabledcondition expr="leader.wantsAssistance">
      <param name="leader" entity="Employee" value="leader" />
    </disabledcondition>
  </property>
</entity>
Personal tools