Hi All,
I have editable grid in my UI, I have validations in the rows. i gave edit button and save button on each row to edit and save the particular row.
but when i click on save button, it is validating the entire grid rows not only that particular row.
Can you please help how to validate only that particular row when we save it.
Thanks in advance.
SS for reference.
Discussion posts and replies are publicly visible
The icons are which kind of object? A button or a link?You can use buttons and validation groupshttps://docs.appian.com/suite/help/25.4/recipe-use-validation-group-for-buttons-with-multiple-validation-rules.htmlJust give each row its validation group and it should work
It's a button. i would like to add more information here. each row has the same validation not a different validation on each row.and also, we have one more button called "Edit All" when user click that user able to edit the entire grid and we provided the submit button to save the data. the same validation is validated when submit button is clicked.so in this case, can you please guide me how to incorporate validation group. do we need to have 2 validation groups?
The validation group can be put in the button in each row.I guess that you are creating each row with an a!forEach gridRowLayout i guess, right?You can add for each field with validation also the validationGroup: "group"&fv!index or something similar to uniquely identify the row validation. This validation group name is to be used also in the "Save single row" button.On the save all no validation group should be provided, this will validate all the information togheter
Use two validation groups:Row fields + that row’s Save button: validationGroup: row- & tostring(fv!index) so only that row validates.All editable fields (or grid-level validations) + Submit button for Edit All: validationGroup: ALL_ROWS so the whole grid validates only on final submit
If you want each row's save to validate just that row's data then use unique validationGroup for each row 's save button and the same value should be added to each component of the row. You cna use a dynamic validation group e.g. concat("validateRow",fv!index) for each grid component. This way each save button and components of that row will share the same validationGroup and would help run the validations as per expectation.
I'd personally start out with setting the field-level validations to only validate when that row is currently marked as "being edited". That would be a lot easier than using validation groups, IMHO, since its behavior is a little flakey.