try     value="#{true}"  first, if it checked, error in your selected property

On 9/7/05, CONNER, BRENDAN (SBCSI) < [EMAIL PROTECTED]> wrote:
Does it do this even if you omit the binding attribute?  I'm just guessing, but maybe that's interfering with it.
 
- Brendan
-----Original Message-----
From: Balaji Saranathan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 07, 2005 3:34 PM
To: 'MyFaces Discussion'
Subject: RE: DataTable and checkboxes

I understand the part about the event handling for selectAll.
But I'm worried about having the checkbox checked.  There must be some reason why the checkboxes for the rows as specified in the below code does not actually render as checked. I'm just breaking my head over that reason. I assumed, when u specify the value "true", it gets displayed as checked.
 
Thanks
Balaji
 
 
 
 
 -----Original Message-----
From: CONNER, BRENDAN (SBCSI) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 07, 2005 4:20 PM
To: MyFaces Discussion; [EMAIL PROTECTED]
Subject: RE: DataTable and checkboxes

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
-----Original Message-----
From: Mike Kienenberger [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 07, 2005 3:15 PM
To: MyFaces Discussion; [EMAIL PROTECTED]
Subject: Re: DataTable and checkboxes

The "binding" attribute is for associating a reference to your component to a backing bean.
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.



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.

Reply via email to