View States store values accessible to all components of the dashboard. Use them to pass values like user selections or preferences between components and into queries.
View States can be edited from the View State dialog.
Select View State dialog showing a selected View State and its properties
This dialog can be summoned by clicking inside any input box showing the eye icon .
Some inputs offer View States, but the icon is hidden. For some it’s to the left of the Clear button. If a View State is available, a rollover of the input will display the eye icon.
To prevent errors, it may be necessary to include a text prompt to help the user put information in the correct form.
Creating a View State¶
In the Select View State dialog, click New to create a new View State. Name it.
Set the Type:
Set a Default value if required. (This will immediately map to Value.) When a dashboard is loaded it will automatically run queries using the default value.
Click Select Item.
In the Query Editor¶
As new data sources are defined in the Query Editor, it is often convenient to map them immediately to View States.
This can be done with a single click on the eye-and-gear button.
Mapping a query’s
trade argument to an eponymous View State
This will update Value to reflect the mapped View State. For example,
<%Query/value%> as mapped in the image below:
To edit the View State, click on the eye button to summon the Select View State dialog.
Parameter types must match. A parameter’s type is defined in the Select View State dialog. Check to ensure the same type is assigned in the Query Editor for which the View State is assigned.
In Query Editor, if there is an assigned value prior to creating a View State, the created View State will adopt the assigned value as the default value; ensuring the query will run when executed.
Selected Values are available in chart components. Values are captured using:
- Selected Value
- A View State – ‘publishing’ the selection for other components
- Selected Value Attribute
- A column from the component’s Data Source
When mapping Selected Values to Selected Value Attribute, ensure the data type of the View State matches the data type of the Data Source column; e.g. integer for numbered data.
View State Routing¶
Sharing View States across dashboards¶
When sharing View States between different dashboards, matching View States (case sensitive) must be created on the host and destination dashboard. This is relevant when creating Buttons to switch between dashboards, and when using the Navigation component.
For more on Actions
Components can be linked so that changes in one component are reflected in another.
On drilldown, becomes
Drill-down on data grid also updates breadcrumbs and canvas bar chart
Link components by creating a View State and setting it as the Focus property of the linked components.