I have a button which has skipped all rule input field validation on one interface. Right now, I want to get a warning when I click the button without a specific rule input field value.
I couldn't use validationGroup directly because I have made this specific rule input field is mandatory for one more button on the same interface.
Like the example code below, I want to get a warning "text1 is mandatory" when I click the button1. And text1 and text2 are still mandatory field for button2.
load( local!button1, local!button2, local!text1, local!text2, a!formLayout( firstcolumnContents:{ a!textfield( lable: "text1", required: true, value: local!text1, ssaveInto: local!text1 ) }, secondcolunmContents:{ a!textfield( label: "texx2", require: true, value: local!text2, saveInto: local!text2 ) }, buttons: a!buttonlayout:{ primaryButton:{ a!buttonWidegetSubmit( label: "button1", value: true, saveInto: local!button1, skipvalidation: true ), a!buttonWidgetSubmit( lable: "button2", value: false, saveInto: local!button2 ) } } ))
Discussion posts and replies are publicly visible
Hello Tony,
I like most of the suggestions from Mike and Robert which I have used in some complex requirements.
But for me sounds like you can still achieve this with the validation Group but this "little detail" regarding the validationGroup which allows you to add multiple buttons to the form. Before trying all those restructures I strongly recommend you to try the following logic I modified your code which i think is for a version 16.x
load( local!button1, local!button2, local!text1, local!text2, a!formLayout( firstColumnContents:{ a!textfield( label: "text1", required: true, value: local!text1, saveInto: local!text1, validationGroup:"button1" /*<<-- NOTE this*/ ) }, secondColumnContents:{ a!textfield( label: "texx2", required: true, value: local!text2, saveInto: local!text2, validationGroup:"button1 button2" /*<<-- NOTE this*/ ) }, buttons: a!buttonlayout( primaryButton:{ a!buttonWidegetSubmit( label: "button1", value: true, saveInto: local!button1, /*skipvalidation: true*/ /*<<-- NOTE this*/ validationGroup:"button1" /*<<-- NOTE this*/ ), a!buttonWidgetSubmit( label: "button2", value: false, saveInto: local!button2, validationGroup:"button2" /*<<-- NOTE this*/ ) } ) ) )
I haven't found it documented for that reason I am not sure if it was deprecated or is beta or what happens. But so far it have solved the form validations.
Hope this helps
Jose