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
7 replies
Subscribers
7 subscribers
Views
2428 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
#SAIL Hello ! I'm trying some SAIL tutorials, but one
michelb
over 11 years ago
#SAIL
Hello !
I'm trying some SAIL tutorials, but one of them is not working. It's the following:
forum.appian.com/.../SAIL_Recipes
I really need this, since SAIL Forms doesn't have the grid component as we have on Portal Forms.
Trying as a test rule, the following error appears:
"[Lorg.json.JSONObject; cannot be cast to [Lcom.appiancorp.suiteapi.process.TypedVariable;"
And trying as a process model:
"Erro de avaliação de expressão in rule 'multipletextcomponents': Error evaluating function fn!apply :
Expression evaluation error in rule 'ucdynamicfieldeach' (called by rule '27917') at function a!textField:
Invalid index (1) for list: valid range is empty"
I did everything the Recipe said, but unfortunatetly couldn't get it to work. So if someone already tried
it with success, please let me know what am I doing wrong.
Thanks...
OriginalPostID-99840
OriginalPostID-99840
Discussion posts and replies are publicly visible
Parents
0
michelb
over 11 years ago
Patty, here they are:
ucDynamicFieldsUpdateArray:
=with(
local!newGuestList: updatearray(ri!guests, ri!index, ri!newValue),
if(isnull(local!newGuestList[count(local!newGuestList)]),
local!newGuestList,
append(local!newGuestList, "")
)
)
ucDynamicFieldEach:
=a!textField(
label: if(ri!index=1, "Guest Names", ""),
refreshAfter: "KEYPRESS",
value: ri!guests[ri!index],
saveInto: ri!guests << rule!ucDynamicFieldsUpdateArray(ri!index, ri!guests, _)
)
multipleTextComponents:
=a!formLayout(
label:"SAIL Example: Add Text Components Dynamically",
firstColumnContents: {
/* The guests array is passed to the rule directly, creating a partial function */
a!applyComponents(
function: rule!ucDynamicFieldEach(index: _, guests: ri!guests),
array: 1+enumerate(count(ri!guests))
)
},
buttons: a!buttonLayout(
primaryButtons: a!buttonWidgetSubmit(label: "Submit")
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
michelb
over 11 years ago
Patty, here they are:
ucDynamicFieldsUpdateArray:
=with(
local!newGuestList: updatearray(ri!guests, ri!index, ri!newValue),
if(isnull(local!newGuestList[count(local!newGuestList)]),
local!newGuestList,
append(local!newGuestList, "")
)
)
ucDynamicFieldEach:
=a!textField(
label: if(ri!index=1, "Guest Names", ""),
refreshAfter: "KEYPRESS",
value: ri!guests[ri!index],
saveInto: ri!guests << rule!ucDynamicFieldsUpdateArray(ri!index, ri!guests, _)
)
multipleTextComponents:
=a!formLayout(
label:"SAIL Example: Add Text Components Dynamically",
firstColumnContents: {
/* The guests array is passed to the rule directly, creating a partial function */
a!applyComponents(
function: rule!ucDynamicFieldEach(index: _, guests: ri!guests),
array: 1+enumerate(count(ri!guests))
)
},
buttons: a!buttonLayout(
primaryButtons: a!buttonWidgetSubmit(label: "Submit")
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data