ButtonWidget & ButtonWidgetSubmit

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

Parents
  • 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!!!
Reply
  • 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!!!
Children
No Data