-----Original Message-----The "binding" attribute is for associating a reference to your component to a backing bean.
From: Mike Kienenberger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 07, 2005 3:15 PM
To: MyFaces Discussion; [EMAIL PROTECTED]
Subject: Re: DataTable and checkboxes
I think you want to be using value="#{DataTableHandler.selected}" instead.
Also, since your header checkbox is really just a client-side _javascript_ executor, it might be better to implement it as raw html (wrapped by f:verbatim).
On 9/7/05, Balaji Saranathan <[EMAIL PROTECTED]> wrote:Hi,
My code looks like this.
<h:column id="checkboxColumn">
<f:facet name="header">
<h:selectBooleanCheckbox id="headerCheckbox"
binding= "#{DataTableHandler.headerSelected}"
immediate= "true" onclick="selectAllRows()" />
</f:facet >
<h:selectBooleanCheckbox id="rowCheckbox"
binding= "#{DataTableHandler.selected}"
value= "true" />
</h:column >When I execute this, the header checkbox is selected, where as the other checkboxes in the rows are unchecked. Can anyone help me understand why that happens?
Thanks
Balaji
Confidentiality Notice
The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.
Title: Message
Also,
if you wanted to avoid the _javascript_, you could implement selectAll as an
action method. The easiest way is to remove the immediate="true" attribute
and the event handler, and have your action bean just spin through
the elements of your data bean, setting each one to true and returning "success"
(or some other outcome) that causes the page to be redisplayed. (If you do
it this way, you may have to do a <t:saveState> on your bean to make sure
your list remains in the component tree.)
-
Brendan
- RE: DataTable and checkboxes CONNER, BRENDAN \(SBCSI\)
- RE: DataTable and checkboxes Balaji Saranathan
- RE: DataTable and checkboxes CONNER, BRENDAN \(SBCSI\)
- Re: DataTable and checkboxes Zhong Li
- RE: DataTable and checkboxes Balaji Saranathan
- RE: DataTable and checkboxes Balaji Saranathan
- Re: DataTable and checkboxes Zhong Li
- RE: DataTable and checkboxes CONNER, BRENDAN \(SBCSI\)
- RE: DataTable and checkboxes CONNER, BRENDAN \(SBCSI\)
- RE: DataTable and checkboxes Balaji Saranathan
- RE: DataTable and checkboxes CONNER, BRENDAN \(SBCSI\)

