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
3 replies
Subscribers
8 subscribers
Views
1369 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Hi there, I'm suing the Advanced Forms API Plugin. In a form, I&
jdegraaf
over 11 years ago
Hi there,
I'm suing the Advanced Forms API Plugin. In a form, I'm displaying a dynamic dropdown using the populateDropdown function. The data i'm displaying (and the corresponding values) is of type 'text'.
My problem is that on load of the form, the dropdown always displays the top level item, and is refusing to use the default item that I'm telling the field to use.
For example: if the default item for the field is third in the list of items that the dropdown displays, it will still by default display the first item, even though the third item seems to be available in the dropdown.
Is using a default value in combination with the populateDropdown function possible? If so, would you be able to let me know how you're doing it?
Thanks!...
OriginalPostID-98437
OriginalPostID-98437
Discussion posts and replies are publicly visible
0
jdegraaf
over 11 years ago
Of course, when I say 'I'm suing the Advanced Forms API Plugin', I obviously mean 'I'm using...'.
I will only sue them if I can't get this to work ;-)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 11 years ago
Looking at the FormExt.js I can see the default value you select in Appian is lost when the dropdown is reloaded with the new values.
This basically happens because the default value is not stored anywhere I guess to simplify the functionality, therefore in FormAPI.updateDropdownValues() the code simply sets it to the first item in the dropdown:
var choices = {
entries : [],
selected : [ 0 ]
};
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 11 years ago
You could add an additional argument (numeric) to the populateDropdown() function and keep passing it until it reaches FormAPI.updateDropdownValues() and assign that index to the "selected" attribute of the "choices" variable.
Just remember that this will require you to replace the JS file that comes inside the Advanced Form Utilities JAR and that you should document that as a new version for it to be deployed in other environments and avoid inconsistent behavior.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel