Sure,

I would recommend that you have a look at the Tomahawk examples for
tree2 and go from there. You will only need one or two facets,
depending on if you decide to show the files in the tree or not.
Example:

<t:tree2 var="_folder" value=#{bean.folderModel}">
  <f:facet name="folder">
    <t:commandLink action="#{bean.loadContents">
      <t:updateActionListener
        property="#{bean.selectedFolder}"
        value="#{_folder}" />
     </t:commandLink>
  </f:facet>
</t:tree2>



On 11/5/07, Roman <[EMAIL PROTECTED]> wrote:
> Thank you,
>
> I was just thinking of using tree2 for file browsing on the server. Can this
> be accomplished with tree2??
>
>
>
> On 11/5/07, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> > No, this should not work to my knowledge
> >
> > The reason is that the facet is a key in a map to a component. Hash
> > map keys are not dynamic. If they even stored an EL expression, they
> > would not be evaluated at the right time for what you are trying to
> > do.
> >
> > If you use JSP, you could use ${}, and for facelets, this would be
> > evaluated at compile time. Either way, the var would not be populated.
> >
> > The very nature of what you are trying to do is wrong I am afraid. A
> > facet is a component. Components are built during compile time. Data
> > tables are evaluated at run time. As a result, you are trying to have
> > the data table dynamically add and remove facets from a component
> > while the loop is occurring.
> >
> > To do this, you will have to either (1) create a facet for every
> > possible folder type or (2) use c:forEach to build the components
> > during compile time.
> >
> > In addition, I don't even see why you would want to do this. You only
> > have one facet, so all nodes would look the same, what would changing
> > the name of the facet give you? Just use one node type in building
> > your tree model for folders.
> >
> > On 11/5/07, Roman < [EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > Is it possible to use dynamic values in f:facet inside name property???
> > > Something like that:
> > >
> > >     <t:dataList value="#{treeBacker.folderList }" var="folder">
> > >
> > >         <t:tree2 id="clientTree" value="#{ treeBacker.treeData}"
> var="node"
> > > varNodeToggler="t">
> > >                 <f:facet name="#{ folder.name}">
> > >                     <h:panelGroup>
> > >                             <f:facet name="expand">
> > >                                 <t:graphicImage
> > > value="images/yellow-folder-open.png" rendered="#{t.nodeExpanded}"
> > > border="0"/>
> > >                             </f:facet>
> > >                             <f:facet name="collapse">
> > >                                 <t:graphicImage
> > > value="images/yellow-folder-closed.png" rendered="#{!t.nodeExpanded}"
> > > border="0"/>
> > >                             </f:facet>
> > >                             <h:outputText value="#{node.description}"
> > > styleClass="nodeFolder"/>
> > >                     </h:panelGroup>
> > >                  </f:facet>
> > >             </t:tree2>
> > >
> > >
> > >     </t:dataList>
> > >
> > > Thank you,
> > > Roman.
> > >
> > >
> >
>
>

Reply via email to