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
11 replies
Subscribers
8 subscribers
Views
3290 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hello, I have an editable grid that allows for columns to be added dy
issamd
over 10 years ago
Hello,
I have an editable grid that allows for columns to be added dynamically. I have found a strange issue that occurs when the last row in the grid is deleted an error is returned related to the being out of bounds of the array. The only solution I've found is to enclose the entire expression in a Load(), but I'd like to find a way to do this without the Load(). Has anybody ran into this? Can my issue be identified?
Code Below:
load(
a!gridRowLayout(
id: ri!index,
contents: {
a!textField(
label: "First Name" & ri!index,
required: true,
requiredMessage: "A First Name is required for this field.",
value: ri!items[ri!index].FirstName,
saveInto: ri!items[ri!index].FirstName << fn!trim
),
a!textField(
label: "Last Name" & ri!index,
required: true,
requiredMessage: "A Last Name is required for this field.",
value: ri!items[ri!index]....
OriginalPostID-139103
OriginalPostID-139103
Discussion posts and replies are publicly visible
Parents
0
Josh
Certified Lead Developer
over 10 years ago
I was looking at my code when I gave that suggestion! Assuming you itemsToken definition is in a load() try defining "local!itemsToken: ri!externalPerson" The out of bounds array issue is because your rule input has data in it but your token has not yet been initialized so in the gridRow code when you try to remove a value, you can successfully remove it from "ri!items" since it already exists, but we haven't put it in "ri!itemsToken" so we can't remove what isn't there.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Josh
Certified Lead Developer
over 10 years ago
I was looking at my code when I gave that suggestion! Assuming you itemsToken definition is in a load() try defining "local!itemsToken: ri!externalPerson" The out of bounds array issue is because your rule input has data in it but your token has not yet been initialized so in the gridRow code when you try to remove a value, you can successfully remove it from "ri!items" since it already exists, but we haven't put it in "ri!itemsToken" so we can't remove what isn't there.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data