Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Advanced Tasks : Using a Check Box to Set Properties for Another Control

Using a Check Box to Set Properties for Another Control
This section explains how to use a check box to set certain properties, such as visibility, enabled, and required for another control.
Task
Set the value of a visibility, enabled, or required flag for a given control at run-time based on the value of a checkbox control.
Sample Project
forms.samples.controls/Forms/Visibility/VisibilityBinding
To view the sample for this task, import the advanced sample projects as described in Import the Forms Advanced Samples. The sample form for the task described in this section is contained in the forms.samples.controls project.
The form (VerticalBinding.form) is at the following location:
   forms.samples.controls/Forms/visibility/
You can double-click the form’s filename (as well as those of other project resources) in the Project Explorer to open it in the editor. There, you can examine it and use it as a model for your own projects.
Explanation
To set up the visibility flag of a text control based on the checkbox control value, perform the following steps:
1.
2.
Go to the General properties for the checkbox control.
Create a binding for the Value attribute of the checkbox and set it to the Visible property of the text control. The direction of this binding is from the check box Value to the Visible property of the text control.
3.
When you load the form, the check box is in cleared condition and Text Control1 is invisible. If you select the checkbox control, Text Control1 becomes visible in the form.
To set up the enabled flag of a text control based on the checkbox control value, perform the following steps.
1.
2.
Go to the General properties for the checkbox control.
Create a binding for the Value attribute of the checkbox and set it to the Enable property of the text control. The direction of this binding is from the check box Value to the Enable property of the text control.
3.
When you load the form, the check box is in cleared condition and Text Control2 is in a disabled state. If you select the checkbox control, Text Control2 is enabled on the form.
To set up the required flag of a text control based on the checkbox control value, perform the following steps.
1.
2.
Go to the General properties for the checkbox control.
Create a binding for the Value attribute of the checkbox and set it to the Required property of the text control. The direction of this binding is from the check box Value to the Required property of the text control.
3.
When you load the form, Text Control3 is marked as Not Required. If you select the checkbox control, Text Control3 is marked as Required on the form.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved