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
3052 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Dynamic grid BatchSize
ashman
over 8 years ago
Hi All,
I have a usecase where I need to pass the dynamic values for the batchsize for the grid. Initially grid should have a default value of 25.Then user can able to change the batchsize and I should validate the batchsize should not be less than 1 and greater than 50.I tried with local variables by using "with" and it is not allowing me to save the values.Any help would be appreciate it.
TIA.
OriginalPostID-232411
Discussion posts and replies are publicly visible
0
Tom Ryan
Appian Employee
over 8 years ago
I don't think this will work. If you change the batch size dynamically, it will cause an error when the updated batch size doesn't match the current batch size.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 8 years ago
Hi Ashman, can you attach the code snippet?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashman
over 8 years ago
with(local!activeBatchSize:25,
a!sectionLayout(firstColumnContents:{a!integerField(
label: "Results per Page",
labelPosition: "ABOVE",
value:ri!batchSize,
saveInto: {
local!activeBatchSize,
a!save(
ri!batchSize,
if(or(save!value=0,save!value<0),ri!batchSize, save!value)
)
},
validations:if(or(tointeger(local!activeBatchSize)=0,tointeger(local!activeBatchSize)<1,tointeger(local!activeBatchSize)>50),"Please enter a number between 1 and 50",{})
)}))
Note:ri!batchSize will be loaded with value 25
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 8 years ago
load(
local!activeBatchSize: ri!batchSize,
a!sectionLayout(
firstColumnContents: {
a!integerField(
label: "Results per Page",
labelPosition: "ABOVE",
value: local!activeBatchSize,
saveInto: {local!activeBatchSize},
validations: {
if(or(local!activeBatchSize<1,local!activeBatchSize>50),
"Please enter value between 1 and 50",{})}
),
a!integerField(
label:"Test value",
value:local!activeBatchSize
)
}
)
),
Please note that: you need to reset the batch size in paging info using the local!activeBatchSize value. let me know if that worked or not
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 8 years ago
To the best of my knowledge, along with the batchSize, it is also required to reset the startIndex if we aren't on the first page. Resetting the batchSize in pagingInfo needs to be done anyhow as the user is being provided an option to change it. So resetting the startIndex in pagingInfo is what we should handle additionally.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 8 years ago
@Sikhivahan, Thank you. We should reset the StartIndex. I missed that
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashman
over 8 years ago
Thank you All
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel