You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Rogério Saulo <ro...@gmail.com> on 2005/08/15 18:56:52 UTC

Problem with empty x:tree

Hi, 

I do not know if I´m misunderstanding something, but anyone can tell me how 
to create an empty x:tree component?

When I try to update my tree and the root element does not have any children 
in the new tree, i receive an IndexOutOfBoundException and if I try to set 
the treeModel to null the component try to render and obviously I get an 
error on the first field.

Here is my JSP code :

<x:tree id="tree" value="#{DesktopBean.treeModel}" 
var="treeItem"
styleClass="standardTreeTable"
headerClass="standardTreeTable_Header"
rowClasses="standardTable_Row1,standardTable_Row2"
columnClasses="standardTable_ColumnCentered, standardTable_ColumnCentered, 
standardTable_ColumnCentered, standardTable_ColumnCentered"
selectedNodeClass="treenodeSelected"
nodeClass="treenode"
expandRoot="true" >
<x:treeColumn>
<f:facet name="header">
<h:outputText value="Label" />
</f:facet>
<h:outputText value="#{treeItem.labelTagDesktop}" />
</x:treeColumn>
<h:column>
<f:facet name="header">
<h:outputText value="ID" />
</f:facet>
<h:outputText value="#{treeItem.idDesktop}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Nome Tag" />
</f:facet>
<h:outputText value="#{treeItem.nomeTagDesktop}" />
</h:column>
</x:tree>

Thanks
Rogerio

Re: Problem with empty x:tree

Posted by Sean Schofield <se...@gmail.com>.
Suggestion: Most people are using <t:tree2> now.  You will probably
find more people able to help you with that one.

sean

On 8/15/05, Rogério Saulo <ro...@gmail.com> wrote:
> Hi, 
> 
> I do not know if I´m misunderstanding  something, but anyone can tell me how
> to create an empty x:tree component?
> 
> When I try to update my tree and the root element does not have any children
> in the new tree, i receive an IndexOutOfBoundException and if I try to set
> the treeModel to null the component try to render and obviously I get an
> error on the first field.
> 
> Here is my JSP code :
> 
>                 <x:tree id="tree" value="#{DesktopBean.treeModel}" 
>                         var="treeItem"
>                         styleClass="standardTreeTable"
>                        
> headerClass="standardTreeTable_Header"
>                        
> rowClasses="standardTable_Row1,standardTable_Row2"
>                        
> columnClasses="standardTable_ColumnCentered,
> standardTable_ColumnCentered, standardTable_ColumnCentered,
> standardTable_ColumnCentered"
>                        
> selectedNodeClass="treenodeSelected"
>                         nodeClass="treenode"
>                         expandRoot="true" >
>                     <x:treeColumn>
>                         <f:facet name="header">
>                             <h:outputText value="Label" />
>                         </f:facet>
>                            <h:outputText value="#{treeItem.labelTagDesktop}"
> />
>                     </x:treeColumn>
>                     <h:column>
>                         <f:facet name="header">
>                             <h:outputText value="ID" />
>                         </f:facet>
>                         <h:outputText value="#{treeItem.idDesktop}" />
>                     </h:column>
>                     <h:column>
>                         <f:facet name="header">
>                             <h:outputText value="Nome Tag" />
>                         </f:facet>
>                         <h:outputText value="#{treeItem.nomeTagDesktop}" />
>                     </h:column>
>                  </x:tree>
> 
> Thanks
> Rogerio
>