Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

check box problem.

 
swapnel surade
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic