AX1327
Controlling component visibility and enabled status
When designing an Axiom form, you may want to dynamically control whether a particular component is visible and/or whether that component is enabled. You can do this by using a formula in the following properties for the component:
- Visible: Controls whether the component is visible.
- Enabled: Controls whether the component is enabled. Only supported for certain components.
By default, both of these settings are set to On, meaning the component is visible and enabled. If you want to modify either of these settings, you must do so on the Form Control Sheet (because this is the only way to enter formulas into component settings). These settings do not display in the Form Assistant or the Form Designer.
To easily find these settings for a particular component, you can use the Form Assistant task pane. Select the component in the thumbnail, and then click the Show Control Sheet link to jump directly to settings for that component in the Form Control Sheet. The Visible and Enabled settings are located at the top of the component's settings, after the Component Name.
Showing or hiding a component
You may want to dynamically hide or show a component based on other selections made in a form. For example, you could have a check box that shows or hides a chart. In the Visible setting for the chart, you would enter a formula something like:
=IF(Control_Form!D45="On","On","Off")
Where D45 is the location of the Is Checked setting for the check box on the Form Control Sheet. If this is set to On (meaning the check box is checked), then the Visible setting for the chart will be set to On and the chart will be visible. If the check box is set to Off (unchecked), then the Visible setting for the chart will be set to Off and the chart will be hidden.
If you have several components that you want to make visible or hidden as a group, then you can place all of these components on a dedicated layer, or make them all child components of a Panel component. You can then use the Visible setting on the layer or the panel to show or hide all of those components at once. This approach is often used to switch between different "pages" or "screens" within a form—by grouping related components on a layer or a panel, and then showing or hiding the layer or panel as appropriate.
In some cases you may want to show or hide a component depending on where the form is being viewed. You can use the GetDocumentInfo("EmbeddedFormType")
function to return the current context of the form. This function has the following return values:
- <Blank>: The form is open in a browser (Web Client). The function will also return blank while you are working within the source file for the form, or if the function is used in any non-form-enabled files.
Tab
: The form is open as a web tab in the Excel Client or Windows Client.Dialog
: The form is open as a modal dialog in the Excel Client or Windows Client.TaskPane
: The form is open as a task pane in the Excel Client or Windows Client.
Enabling or disabling a component
You may want to dynamically enable or disable a component based on other selections made in a form. If a component is disabled, then it displays as grayed out and users cannot interact with it.
For example, the form may have a button that the user can click to update a grid of data in the form, but you only want this button to be available after the user has made a selection from a particular combo box. In the Enabled setting for the button, you would enter a formula something like:
=IF(Control_Form!D53="","Off","On")
Where D53 is the location of the Selected Value setting for the combo box on the Form Control Sheet. If this is blank (meaning no selection has been made yet), then the Enabled setting for the button will be set to Off and the button will be disabled. If the combo box has a selected value (is not blank), then the Enabled setting for the button will be set to On and the user can click the button.
The following components support the Enabled setting: Button, Check Box, Combo Box, Hyperlink, Radio Button, Text Box.