This example is similar
to using a value to show or hide options. However, in this case, the
options are already visible in the user interface. Selecting a value
from the combobox control enables these additional options, so the
user can set these options.
In the Advanced task
if you select the Enable/Disable Options radio
button, the values in the combobox are determined by these lines of
code:
<Option name="comboEnableChange" defaultValue="valueEnableColor"
inputType="combobox" width="100%">Combobox:</Option>
<Option name="valueEnableColor" inputType="string">Enable the color
selector</Option>
<Option name="valueEnableDate" inputType="string">Enable the date picker</Option>
<Option name="valueEnableSlider" inputType="string">Enable the slider
control</Option>
The dependency code
for the Enable/Disable Options radio button
(referred to as radioEnableDisable in the XML) shows that when this
radio button is selected, five options (labelEnableChange, comboEnableChange,
colorControl, dateControl, and sliderControl) appear in the user interface:
Here is the dependency
code:
<Dependency condition="$radioChoice == 'radioEnableDisable'">
<Target action="show" conditionResult="true" option="labelEnableChange"/>
<Target action="show" conditionResult="true" option="comboEnableChange"/>
<Target action="hide" conditionResult="true" option="labelShowChange"/>
<Target action="hide" conditionResult="true" option="comboShowChange"/>
<Target action="show" conditionResult="true" option="colorControl"/>
<Target action="show" conditionResult="true" option="dateControl"/>
<Target action="show" conditionResult="true" option="sliderControl"/>
<Target action="hide" conditionResult="true" option="labelShowSet"/>
<Target action="hide" conditionResult="true" option="comboSetChange"/>
<Target action="hide" conditionResult="true" option="checkboxCheckUncheck"/>
</Dependency>
The user interface shows
the colorControl (labeled Choose a color),
the dateControl (labeled Choose a date),
and the sliderControl (labeled Slider with buttons)
options. However, only the Choose a color option
is enabled because Enable the color selector option
is selected in the Combobox control, which
means this dependency code is met:
<Dependency condition="$comboEnableChange == 'valueEnableColor'">
<Target sction="enable" conditionResult="true" option="colorControl"/>
<Target action="disable" conditionResult="true" option="dateControl"/>
<Target action="disable" conditionResult="true" option="sliderControl"/>
</Dependency>
If you select Enable
the date picker from the combobox control, the conditions
for this dependency are met:
<Dependency condition="$comboShowChange == 'valueShowDate'">
<Target action="disabel" conditionResult="true" option="colorControl"/>
<Target action="enable" conditionResult"="true" option="dateControl"/>
<Target action="disable" conditionResult="true" option="sliderControl"/>
</Dependency>
The date picker control
is enabled in the user interface.
<Option name="dateControl" inputType="datepicker" format="monyy7.">
Choose a date:</Option>
The color and slider
controls are still visible in the user interface, but they are disabled.