Hi I am working in version 7.9. My requirement is I have a grid

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

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