aspose file tools*
The moose likes JSF and the fly likes How to enable a button when a checkbox is selected, without a setter nor a backing bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How to enable a button when a checkbox is selected, without a setter nor a backing bean" Watch "How to enable a button when a checkbox is selected, without a setter nor a backing bean" New topic
Author

How to enable a button when a checkbox is selected, without a setter nor a backing bean

baris can
Greenhorn

Joined: May 26, 2010
Posts: 1
Hi all,

It is my first post, wish me good luck

I am developing a web app using Seam, JSF, EJB3, hibernate.
I have a datatable, and checkboxes in each row. In order to clearify it, I attached my code below:



As you see, there are a number of checkboxes will be rendered as the datatable iterates resultList.
When a checkbox is selected, the "selectValue" (which is a 'transient' boolean property of the entity apiV2Product) will be set if only a command button is clicked or another action is performed.
It is what I want. User selects checkboxes in the client side, and it does not goes setter of "selectValue" on each selection, but goes and set the related values only an action performed (like a button clicked)

So far, my problem is, I want to enable a buton when at least one checkbox is selected without calling a setter or an action.
On the other hand, I dont know how to manage if none of the checkboxes is selected or not.
Because, in my case, the point is when none of the checkboxes is selected, button will be disable. And even if one of the checkboxes is selected, button must be enable indeed.
Is there any approach to this case you know? Is it possible by using Jquery or jsFunction, richfaces, etc.?

Any help would be appreciated
Many thanks
Bariscan
 
Consider Paul's rocket mass heater.
 
subject: How to enable a button when a checkbox is selected, without a setter nor a backing bean
 
Similar Threads
Check box is not re-rendered after bean execution
How do you implement Tomahawk tree control with a CheckBox?
Model update problem
DataTable and Select All Checkboxes
SelectAll checkbox in header column