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
2033 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Hi I am working in version 7.9. My requirement is I have a grid
komalc3
A Score Level 1
over 9 years ago
Hi
I am working in version 7.9.
My requirement is I have a grid in which I can select rows and I have a button below. If I select more than 1 row and hit the button, I should get a validation message that I cannot select more than one. For this I am writing a condition in a!formLayout's validations{} like:
if(and(count(ri!selectedIndices)>1,ri!buttonOptionSelected="Submit"),
a!validationMessage(message:"Please do not select more than one"),{}
)
But my form completes and I don't get to see this error message.I guess this is because on hitting the button I am taken out of the form.
Can any one please guide me for the same.
Thanks in advance!!
OriginalPostID-160395
OriginalPostID-160395
Discussion posts and replies are publicly visible
0
janakik
over 9 years ago
There is nothing wrong in the above piece of code. It will be easy to trace if you could share the part of code involving the ri inputs.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 9 years ago
Does your button skip validation?
Alternatively, please use the validation example provided in the SAIL recipes. I believe this should fit your use case.
forum.appian.com/.../SAIL_Recipes.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
komalc3
A Score Level 1
over 9 years ago
Thanx Janak and Micheal for replying.
My requirement is not just limiting the rows selected but the rows selected and button clicked combination is what I want to use to display the message so the recipe won't help me much Micheal.
Janak ri!selectedIndices stores the ids of the rows selected from the grid and ri!buttonOptionSelected stores the value of the button clicked.
The code for button is:
a!buttonWidgetSubmit(
label: "Submit",
style: "NORMAL",
value:"Submit",
saveInto: ri!buttonOptionSelected
)
Hope this helps in explaining my problem with more clarity.
Thanx in advance!!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 9 years ago
Here is a test expression (all with local variables). This should satisfy your requirement, not sure where the difference on your end is.
test.txt
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
komalc3
A Score Level 1
over 9 years ago
Hi Michael
Thanx for replying.
As mentioned in my query I am also putting my validations in the validations section of a!formLayout (the same is being depicted in your sample code).
My SAIL expression is working fine but my UI doesn't stay to display the error message.
Janak, you can refer to this sample code from Michael.
Thanx in advance!!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
janakik
over 9 years ago
Can you share your code?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
komalc3
A Score Level 1
over 9 years ago
Hi Michael and Janak
Thanx for ur replies!!
I am able to find a solution to my problem. Please find attached for the solution.
test.txt
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel