A Group element
can be the target of a dependency. However, if you want a Group element
to be the target of a dependency and you also want a child of that
group to be the target with a different set of conditions, you must
include all of the conditional logic for the group and the child in
one dependency.
This example demonstrates
this behavior.
<UI>
<Container option="data">
<Group option="datagroup">
<Option name="CheckBoxEnableTargetGroup" />
</Container>
<Container option="options">
<Group option="targetGroup">
<Option name="COMBOBOX"/>
<Option name="ITEM1"/>
<Option name="ITEM2"/>
<Option name="ITEM3"/>
<OptionItem option="CHECKBOX"/>
<OptionItem option="INPUTTEXT"/>
</Group>
</Container>
</UI>
<Dependencies>
1<!-- Correct -->
<Dependency condition="$CheckBoxEnableTargetGroup=='1'">
<Target conditionResult="true" option="targetGroup" action="show"/>
<Target conditionResult="false" option="targetGroup" action="hide"/>
</Dependency>
<Dependency condition="$CheckBoxEnableTargetGroup=='1' && $CHECKBOX=='1'">
<Target conditionResult="true" option="INPUTTEXT" action="enable"/>
<Target conditionResult="false" option="INPUTTEXT" action="disable"/>
</Dependency>
2<!-- Incorrect -->
<Dependency condition="$CheckBoxEnableTargetGroup=='1'">
<Target conditionResult="true" option="targetGroup" action="show"/>
<Target conditionResult="false" option="targetGroup" action="hide"/>
</Dependency>
<Dependency condition="$CHECKBOX=='1'">
<Target conditionResult="true" option="INPUTTEXT" action="enable"/>
<Target conditionResult="false" option="INPUTTEXT" action="disable"/>
</Dependency>
</Dependencies>
| 1 |
In
the first dependency, the $CheckBoxEnableTargetGroup Velocity variable
is used to show or hide the option named targetGroup.
The author of this task also wants the option named INPUTTEXT to
be displayed based on the state of the $CHECKBOX Velocity variable.
|
| 2 |
In
the second dependency, the logic for targeting the option named targetGroup is
omitted. When writing a dependency that targets a group, you must
decide whether you want to target the children of that group as well.
|