Step 8: Create the Dependency

Use the Dependencies element to specify when each informat option should appear.
Add this code immediately after the closing UI element (</UI>).
<Dependencies>
<Dependency condition="$informatType == 'numericChoice'">
      <Target action="show" conditionResult="true" option="numericInformat"/>
      <Target action="hide" conditionResult="true" option="dateInformat"/>
   </Dependency>
   <Dependency condition="$informatType == 'dateChoice'">
      <Target action="hide" conditionResult="true" option="numericInformat"/>
      <Target action="show" conditionResult="true" option="dateInformat"/>
   </Dependency>
</Dependencies>
Here is an explanation of the code:
Explanation of the Code
1 According to this dependency condition, when you select the Numeric option (named numericChoice) from the Informat drop-down list (named $informatType), the Numeric informat option (named numericInformat) is available in the user interface. The Date informat option (named dateInformat) is hidden.
2 According to this dependency condition, when you select the Date option (named dateChoice) from the Informat drop-down list (named $informatType), the Date informat option (named dateInformat) is available in the user interface. The Numeric informat option (named numericInformat) is hidden.
Click Run Icon to generate the user interface for the task.
When you run the task, the first value in the combobox control (Numeric) is selected by default. As a result, the Numeric informat option is displayed.
Numeric Informat Option for the Example Task
If you select Date from the Category of Informat drop-down list, the Date informat option appears, and the Numeric informat option is hidden.
Date Informat Option for the Example Task
Close the task interface and return to the CTM code. Click Save Icon to save your CTM code.