Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
7 subscribers
Views
1618 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Hi, In Advance Form Utilities, we are able to use populateDropdown to popul
Will Teoh
over 10 years ago
Hi,
In Advance Form Utilities, we are able to use populateDropdown to populate the dropdown option dynamically. However, is there a way to set the default value of the dropdown field? eg: dropdown value: {"Apple", "Orange", "Mango"}, default value: Orange. So when the form shows up, it will show Orange instead of Apple.
Thanks
...
OriginalPostID-100311
OriginalPostID-100311
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 10 years ago
You will have to modify the JS code of the component. More information at
forum.appian.com/.../e-98437
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 10 years ago
Hi Eduardo, in this case, will it be easier to use jQuery? My idea is load the js to populate the dropdown, and then only load the jquery script to preset the default value.
var hiddenFieldValue = FormAPI.getValue(hiddenFieldId).id;
$('#dropdownControl_fd_component_' + window.FormDesigner.runtimeNamespace + fieldId).val(hiddenFieldValue);
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
Yes you can make that an extra call instead of modifying the code. You should give that a go.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 10 years ago
I have tried but there is no response to the onload event thus no default value is set. If i put an alert to display the hiddenFieldValue, it does return the correct value. How can I fix this???
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
Use IE Developer Tools (hitting F12) and its scripting feature to debug. Put a
debugger;
line in your code so you can inspect elements and run tests.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel