I have an h:dataTable
inside of an h:form
, where each row has it's own h:commandButton type="submit" action="#{bean.saveChanges(item)}"
.
f:inputs
are declared as required
and they also need to match a pattern
.
If every input is in the right format, then it works fine.
Otherwise it needs only one input to be wrong and an updating function on a commandButton
corresponding to a completely different item in another row seems not to be called, therefore not updated in the database.
Also only the wrong row's validation message is displayed and the changes are maintained in the view by a (backing Spring view scoped) bean, so the user might actually think, that the initial row was indeed updated in the database too.
Is there a way, how to separate individual rows of the h:dataTable
, so that the validation messages of another row does not stop other items from being updated by the method of a (Spring/backing) bean?