Symptoms
How to set a Default value for a Dropdown list, Choice or Picker control
Diagnoses
How to set a Default value for a Dropdown list, Choice or Picker control
Resolution
Getting a dropdown list, Choice or Picker control to revert back to a default state.
If the dropdown and the choice control is populated with A,B,C,D which is originating from an SmartObject then for arguments sake let’s say you want C to be the default for the dropdown, picker andor the choice control, so that when the user selected an option (Option A,B,C or D) and again for arguments sake presses a button the controls should go back to C (a specified value) as is was when the view was loaded.
Solution:
1. In your view add a text box in the text boxes text property specify an ID of one of the values in the SmartObject that would be
populated into the dropdown, choice or picker control.
2. Then add a test button, add the transfer rule on the button click and configure the transfer data by dragging in the text box.
3. Then in the initialize rule call "execute anther rule" and select the on button click rule created in step 2.
4. Save and finish.
5. Test the view and controls.
You will notice that the dropdown list, choice and picker control will start with the value specified in the textbox, if you select other options in any of the controls you can at any time press the test button, you will notice that all three controls will revert back to the value which id was specified in the textbox.
Note if the text box would be in the way, you can set it to be invisible and disable it.