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
4 replies
Subscribers
7 subscribers
Views
4596 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
ButtonWidget & ButtonWidgetSubmit
Will Teoh
over 8 years ago
Hi,
In SAIL form, may I know if the button is pressed and the form failed the validations, will the data that defined in the saveInto of the button will still be able to be saved?
For instance, I have 2 different validations on a grid, depending on the button that the user pressed, eg: Reject & Submit, the grid will be validated based on the variable that store the button.
example:
gridField(
...
validations: { if(ri!buttonAction_txt = "Reject", "errorMsg1", if(ri!buttonAction_txt = "Submit", "errorMsg2", ""))
...
),
...
buttons: a!buttonLayout(
primaryButtons: {
a!buttonWidget(
...
value: "Reject",
submit: true,
saveInto: ri!buttonAction_txt
)
OriginalPostID-254363
Discussion posts and replies are publicly visible
0
venkateshamu
A Score Level 2
over 8 years ago
@willt, As per my knowledge value will not store into variable if validation fails.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
darrynj
over 8 years ago
the button's saveInto parameter will not trigger if the validations of the group specified in the validationGroup parameter of the button fail.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
venkateshamu
A Score Level 2
over 8 years ago
In this case buttonwidget with validate false() will work but it will not submit. Please refer below sample code.
load(
local!btn_txt,
{
a!gridField(
label: "Test",
value: ri!pagingInfo,
saveInto: ri!pagingInfo,
totalCount:2,
columns: {
a!gridTextColumn(
label: "Col1",
data: {"1", "2"}
),
a!gridTextColumn(
label: "Col2",
data: {"Test", "Test2"}
)
},
validations:{
if(
local!btn_txt = "Submit",
"Submit Clicked",
if(
local!btn_txt = "Cancel",
"Cancel Clicked",
""
)
)
}
),
a!buttonLayout(
primaryButtons: {
a!buttonWidget(
label: "Submit",
saveInto: local!btn_txt,
value: "Submit",
style: "PRIMARY"
)
},
secondaryButtons: {
a!buttonWidget(
label: "Cancel",
saveInto: local!btn_txt,
style: "NORMAL",
value: "Cancel"
)
}
)
}
)
Please let me know if it works!!!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 8 years ago
yes I am aware that this WILL work. but is not what I wanted. Thx
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel