Appendix: Attribute Types
You can add any number of attributes to as many questions and responses in your application as you wish. The process for adding an attribute is the same, regardless of whether it is for a question or response.
Refer to the following table to see a list of attribute types:
Attribute Type | Description | Further Reading |
---|---|---|
Cause Button Validation | Assigning this type of attribute to a Button or Navigation Button with a value of False (0) will override the standard check that ensures mandatory questions are completed when the button is clicked. This is useful if you expect users to click the button at least once before the form has been fully completed. It can also be useful when debugging an application, since it means you won't have to complete all mandatory questions to navigate between question groups. | Applying Client-side Validation |
Chart Data Expression | Used with the function WithChartData to specify which chart you want the expression to interact with. | |
Child Form Place Holder | This attribute type must be attached to a Place Holder question. It defines which other question group is mapped to the place holder. | Implementing a Place Holder. |
Data Source Connect Expression | Although it can be done manually, an attribute of this type will automatically be added to content that connects to a data source (e.g. a grid or multiple choice question) whenever its Connect to Data Source When Condition is Met check box is ticked and an expression is specified. The attribute will prevent the content from making a connection to its data source unless the expression returns a value of True (1). | Implementing a Data-driven Response List and Refreshing Data using a Question Attribute |
Filter Expression |
A custom instruction that can be associated with a question in order to execute a specific function when certain conditions are met. | Expressions |
Default Response Expression | A special type of expression attached to a question response. When the expression evaluates as 1 (True), the response will be set as the default response to the corresponding question. This is useful if the response list will change based on choices made by the end user, as you can then vary the default response accordingly. Responses that are made default using this type of attribute will override the Default Response check box found in the Response Options panel. | Appendix: Setting the Default Response with an Attribute Expression |
Enable Expression | When the expression you add to this attribute evaluates as 0 (False), the question it is attached to will be greyed-out and the end user will be prevented from using it. Otherwise, the question will be usable as normal. The expression is re-evaluated each time KnowledgeKube executes a postback. | Dynamically Disabling Content |
Expression | This expression will trigger when the current form loads and when a postback occurs. | Expressions |
Hide Question Show Question |
These are legacy attributes that were previously attached to responses in order to show or hide specific questions when the response was selected. Where possible, you should use a Visibility Expression instead. See Visibility Expression in this table for information. | Dynamically Hiding Content |
Mapped to Expression
Mapped to Question Mapped to Variable |
Attaching one of these attributes to a question will cause that question to display the value of a question response, variable, or the result of an expression, respectively. |
Mapping an Expression's Result to a Question |
Max Field Length | Limits the number of characters that users of your application can type into a text-based question field, such as Free Text or Number. | Limiting the Response Size of a Question |
Parameter | A specialised attribute which interacts with certain question types, such as Radio Button Groups and File Uploader in order to control or extend their functionality. Parameters are usually added automatically to questions that need them. | Changing the Layout of a Radio Button Group and |
Parameter Expression |
When added to questions or responses in place of standard Parameter attributes, this type of expression behaves as though it were a parameter, with its result used in place of the standard parameter's Value. This lets you determine a parameters value dynamically. | Expressions |
Refresh Data Source Expression | Applying a Refresh Data Source Expression attribute to a data-driven form element - such as a data grid or multiple choice question - lets you control when its cached data should be refreshed. | Refreshing Data using a Question Attribute |
Role Based Visibility Expression | This is a legacy feature that determines the visibility of content depending on the user role. This has been superseded as you can now achieve the same result by adding a UserInRole function to a Visibility Expression. | |
Style Class/Style Class Expression | Assigning a Style Class attribute to a question will cause a CSS style class to be applied to the question when it is displayed to the end user. Applying the Style Class Expression executes an expression, the result of which determines which style class is applied to the associated content. Essentially, this type of attribute lets you apply conditional styles rather than the simpler, static ones applied by Style Class attributes. | Applying Custom Question Styles |
Validator Expression |
Used exclusively with Validator questions to determine whether or not the end user's responses are valid for submission. | Applying Client-side Validation |
Visibility Expression |
On postback, hides the question or response it is attached to unless the expression evaluates to 1 (True). | Dynamically Hiding Content |