File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to enable a button when a checkbox is selected, without a setter nor a backing bean