aspose file tools*
The moose likes JSF and the fly likes check box problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "check box problem." Watch "check box problem." New topic
Author

check box problem.

swapnel surade
Ranch Hand

Joined: Mar 05, 2009
Posts: 129
Hi guys,

in my data table there is one column which contains the checkbox. In datatable header is also having one check box
as select all .

On click of select All check box I have to select all the check boxes within the table.

I dont know how to achieve this functionality.

please reply

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
2 ways:

1) Submit form to server during onclick of the "check all" checkbox and set all checkbox property values to true.
2) Use Javascript to set checkboxes in all rows to checked.
swapnel surade
Ranch Hand

Joined: Mar 05, 2009
Posts: 129
Hi

I have done code like this



but its giving me following error
javax.faces.FacesException: javax.el.ELException: javax.faces.el.PropertyNotFoundException: javax.el.PropertyNotFoundException: Property 'selectAllChkBox' not found on type msp.client.surveytemplate.SurveyTemplateListBean

but I have declared the method in the class as

public void selectAllChkBox() {

System.out.println("Working here");
}

but still getting the error

onclick is not supporting the operation
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
That's not how the stuff works. The JSF onclick attribute only takes a ValueExpression and renders a HTML onclick attribute. Whenever you want to attach an action method, you need an attribute taking a MethodExpression, not ValueExpression.

With submitting the form during the onclick I literally mean onclick="this.form.submit()". You may want to add a valueChangeListener to the component which does the actual work.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
I noticed a private message sent by you with a complete copypaste of the reply. This makes absolutely no sense. Don't use the private message for this. There they are not for. This is like pushing me to reply which is considered as rude. Just use the public forums for discussion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: check box problem.
 
Similar Threads
To select all checkbox across all pages in an application
plz solve my problem its urgent
plz solve my problem
need help
Select box get refresh after populating the data into a table.