if you want to display the checkboxes only, i dont think you would be having a prob but if u want to submit the page n get the values of the selected checkboxes in your bean.. i think it wud b a lil prob.. coz i cudnt use checkboxes in a datatable even.. tree table is still ahead of that..
for the datatable, i used jars provided by jenia.. you can check that out if that helps..
 
Regards,
Nimisha.

 
On 8/17/06, Michael Südkamp <[EMAIL PROTECTED]> wrote:
Hi,

I have the following question. I'm modifying the treetable example from the
tomahawk samples. For a columns you would find blocks like this.

         <h:column>
             <f:facet name="header">
                     <h:outputText value="Description" />
             </f:facet>
         <h:outputText value="#{ treeItem.description}" />
         </h:column>

Now I would like to display a checkbox rather then a static text. So I
modified this to

       <h:column>
           <f:facet name="header">
                   <h:outputText value="" />
           </f:facet>
         <h:selectBooleanCheckbox value="#{treeItem.selected}"
styleClass="checkbox"/>
       </h:column>

This displays fine. But there's a problem with the name attribute of the
checkboxes. They all have the same name, e.g. "f:_id5" and this leads
obviously to confusion when submitting the form.

My questions are

1. why does JSF not apply different name attributes automatically?

2. I tried to set the IDs manually by

       <h:column>
           <f:facet name="header">
                   <h:outputText value="" />
           </f:facet>
         <h:selectBooleanCheckbox id="cb#{treeItem.id}"
value="#{treeItem.selected}" styleClass="checkbox"/>
       </h:column>

But it seems that you cannot set ID attributes by _expression_ language. I
always get errors like "# is not allowed character"

Can you help?

Michael


Reply via email to