This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSF and the fly likes Issues with FormSubmission Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Issues with FormSubmission" Watch "Issues with FormSubmission" New topic

Issues with FormSubmission

Varshini Priya
Ranch Hand

Joined: Feb 17, 2008
Posts: 94


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.

Please Assist. Thanks
Eswar Nec
Ranch Hand

Joined: May 02, 2010
Posts: 105
Hi Priya,

Post your code . that will help to easy to identify your problem.

Wake up! Don't let your smile be snatched away by anybody!
Regards, Eswar
Brajendra Mathema
Ranch Hand

Joined: Jun 02, 2009
Posts: 39
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.

I agree. Here's the link:
subject: Issues with FormSubmission
It's not a secret anymore!