I have some issues while clicking on a save button. Im facing the below issues. I have a dataTable and below the datatable is the save button. In the datatable, to populate the table values, Im invoking a restService, which will connect to the DB via Hibernate and fetch the details & populate the data. I also have a checkbox component(h:selectBooleanCheckbox) as one of the component and when I click the checkbox and click on the save button, the service which I use to populate the values in the dataTable is getting invoked again. Can you please let me know/ throw some light as to why this is happening. The only common aspect is that both the commandButton and the datatable are present inside the same form. Also when I click on the submit button, inside the actionListener, the checkbox that is checked is not returning true.
What i guess is ,
since you are submitting the form with the command button ,
you are performing navigation to display the same page again,
so the html data table will call the value that has been bind to it when it is rendered again, therefore your method to query the db is invoked again.
If your check box value is being saved in the db while submitting the form,
the check box should be reflected with the new value when the form is rendered again after submission.