How To: Use the Set a Control's Properties Action
You can change the properties of a control at runtime when an event has executed. You can find these rule actions on a view and form in the Rule Designer.
How to Set a Control's Property at Runtime
- Create a View that looks like the image below. Select the Calendar control, then deselect the Enabled property of the control. We want to enable the Calendar control at runtime if the Passed value is true. To do this, we disable the control and then create a rule to change the Calendar control to Enabled when the Passed value changes to true.
- Go to the rules tab and add a rule.
- Add an event such as When a control on a View raises an event (When Passed Check Box is changed).
- Add an advanced condition to the rule to validate when the Passed value is true as shown below:
- Add the Set a control's properties action
and select the Calendar control.
- Click on configure next to the action.
- Select Yes next to the Enabled property. Click the toggle button to change it to a field if you want to enter text or drag a field from the Context Browser to populate the property.
- Click OK to save the configuration and OK to save the rule.
- Finish and run the view.
- When the view opens, the Calendar is disabled.
- When the Passed check box is checked, the Calendar changes to enabled.
- When you use Boolean properties you can use any permutation of the following values. Any other Boolean value evaluates as FALSE:
- True, False
- 0, 1 (0=False;1=True)
- Yes, No
- You can populate the Expression property of a control with an existing expression from the Context Browser or the GUID of an existing expression.
- You can only map a drop down to the values the control can accept. Note that these values may be different from the display values for the drop down. For example, the Target drop-down of the Hyperlink control has the following display values: New Window, Current Frame and Current Window; but the corresponding value members are _blank, _self and _top (you can get these values by inspecting the drop down’s HTML).