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
1786 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
I have an array of questions that I want to present to a user. For each questio
helmuta
over 9 years ago
I have an array of questions that I want to present to a user. For each question I want the user to give an answer from a dropdownField. I want to present all of the questions with a dropdown field next to each question. I am trying to do this in a gridLayout and I am only getting one item back. Here is a sample of the code.
a!gridLayout(
label: "",
headerCells: {
a!gridLayoutHeaderCell(label: "Question"),
a!gridLayoutHeaderCell(label: "Grade")
},
columnConfigs: {
a!gridLayoutColumnConfig(width: "DISTRIBUTE"),
a!gridLayoutColumnConfig(width: "NARROW")
},
rows: {
a!gridRowLayout(
contents:{
a!textField(
value: index(local!datasubset.data,"question",{})
),
a!dropdownField(
label:"Grade",
required: true(),
...
OriginalPostID-140315
OriginalPostID-140315
Discussion posts and replies are publicly visible
0
helmuta
over 9 years ago
... choiceLabels: cons!VM_GRADES,
choiceValues: cons!VM_GRADES,
placeholderLabel: "Grade",
value: local!grade,
saveInto: local!grade
)
}
)
I know I should be able to iterate through the list of questions and save off a grade for each question but I can not find a way of doing this in SAIL.
Any help would be appreciated.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 9 years ago
You need to put your a!gridRowLayout() in a sub-rule and then use a!applyComponents() to generate a row for each item in your data array. By passing in the index position to the sub-rule you can then display the relative value and saveInto attributes. Check out the SAIL Recipes on the help pages for examples of this.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 9 years ago
wow, I thought I would be able to some how do it inline. Thank you!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 9 years ago
You can continue to repeat your a!gridRowLayout() within your rows:{} attribute for a hard-coded version - literally put a comma at the end and copy+paste another row in. I guess it depends on how many questions you have and if it's going to grow/change?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
nileshr
over 9 years ago
Hi helmuta,
There is no saveInto in the text field. Probably that's why you are getting only one value back.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel