I have a datatable with a checkbox in all rows and I have a commandButton at the bottom. If the user has not selected any row and then clicks the commandButton he gets an error message.
My issue here is:
When the user has not selected anything and clicks the commandButton (for the first time), h:message appears.
After that if the commandButton is clicked again the action method displayStruct is not invoked. If the user then selects a row and clicks the commandButton it works.
Next time if he does not select a row it shows error message (again). After that if he selects the row then it works (again).
So, the thing is if the user does not select any row for the first time, after that for any number of time the commandButton is not getting invoked.#
Here is my code
<p:commandButton
value="Compare"
action="#{historyOrgStructController.displayStruct}"
update=":form" oncomplete="orgStructDialog.show()"
title="View Detail" />
<p:dialog
id="dialog"
header="History on the selected Dates"
widgetVar="orgStructDialog"
showEffect="slide"
hideEffect="slide"
rendered="#{historyOrgStructController.flag}" />