Learn to dynamically set widget values like check a checkbox or set the text on a text panel variables.
Widget Values Overview
Similar to how variable values are set, you can set the values of widgets using interactions. This is useful for interactions like setting the value in a text field to a variable value stored on another page or dynamically checking a checkbox if a condition is met.
Set Widget Values
Add a case to an event, and select “Set Variable and Widget Value(s) equal to Value(s)”. Click on the blue link in the Edit the Actions description area to bring up the Set Variable and Widget Values dialog. Choose from the following types of widget values to set:
Is checked of: Whether a checkbox or radio button is checked.
Selected option of: The current selected option in a droplist or list box.
Text on widget: The text displayed on a widget.
After choosing the type of value, select the widget to set from the second drop down menu. Then, enter or choose the value for the widget (variable value, text, the value of another widget, etc.).
Set Widget Values Using Variables
When setting the text on a widget, click the “Edit text” link in the Set Variable and Widget Values dialog to open the Enter Text dialog. Enter the variable name with “[[“ and “]]” around it to insert variables values into the text. For example, if you want to insert the NameVariable into the text, use “[[NameVariable]]”. You can also use variables when setting the text of text fields and text areas.
Rich text widgets cannot be directly set to values of widgets. However, you can first store the text in a variable value and then set the text to display the variable value as shown below.
Example - Personalized Messages (
RP File |
Prototype )
In this example, a user enters their name in a text field and clicks a submit button. A personalized message is then displayed in a text panel. Follow the instructions in the file to try it yourself.
Summary
Ta-da! Now you can dynamically set widget values from variables and user entered values. Not quite there yet? Email us at support@axure.com.