myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorge Vásquez ...@3eyegroup.com>
Subject Tomahawk tree2
Date Wed, 19 Jul 2006 15:06:29 GMT
Greetings,

I have been doing some trial and error experiments with tomahawk´s tree2
component and I have some questions:

 

1.	How does the component knows which nodes have been opened, where is
this state kept, in order to choose between the opened and closed images?

 

This is the sample code from the demos available:

 

 

            <t:tree2 id="serverTree" value="#{treeBacker.treeData}"
var="node" 

                  varNodeToggler="t" clientSideToggle="false">

                  <f:facet name="person">

                        <h:panelGroup>

                             <t:graphicImage
value="images/yellow-folder-open.png"

                                   rendered="#{t.nodeExpanded}" border="0"
/>

                             <t:graphicImage
value="images/yellow-folder-closed.png"

                                   rendered="#{!t.nodeExpanded}" border="0"
/>

                             <h:outputText value="#{node.description}"
styleClass="nodeFolder" />

                        </h:panelGroup>

                  </f:facet>

                  <f:facet name="foo-folder">

                        <h:panelGroup>

                             <t:graphicImage
value="images/yellow-folder-open.png"

                                   rendered="#{t.nodeExpanded}" border="0"
/>

                             <t:graphicImage
value="images/yellow-folder-closed.png"

                                   rendered="#{!t.nodeExpanded}" border="0"
/>

                             <h:outputText value="#{node.description}"
styleClass="nodeFolder" />

                             <h:outputText value=" (#{node.childCount})"
styleClass="childCount"

                                   rendered="#{!empty node.children}" />

                        </h:panelGroup>

                  </f:facet>

                  <f:facet name="bar-folder">

                        <h:panelGroup>

                             <t:graphicImage
value="images/blue-folder-open.gif"

                                   rendered="#{t.nodeExpanded}" border="0"
/>

                             <t:graphicImage
value="images/blue-folder-closed.png"

                                   rendered="#{!t.nodeExpanded}" border="0"
/>

                             <h:outputText value="#{node.description}"
styleClass="nodeFolder" />

                             <h:outputText value=" (#{node.childCount})"
styleClass="childCount"

                                   rendered="#{!empty node.children}" />

                        </h:panelGroup>

                  </f:facet>

                  <f:facet name="document">

                        <h:panelGroup>

                             <h:commandLink immediate="true"

                                   styleClass="#{t.nodeSelected ?
'documentSelected':'document'}"

                                   actionListener="#{t.setNodeSelected}"
action="#{treeBacker.nodeSelected}">

                                   <t:graphicImage
value="images/document.png" border="0" />

                                   <h:outputText value="#{node.description}"
/>

                                   <f:param name="docDesc"
value="#{node.description}" />

                                   <f:param name="docType"
value="#{node.type}" />

                             </h:commandLink>

                        </h:panelGroup>

                  </f:facet>

            </t:tree2>

 

 

In the above I don’t understand what is the attribute  varNodeToggler? (and
I think that here is where  the answer to my question lies… )

 

2.	I am trying to develop a web-based file explorer and so far I can
paint the selected item´s data on the right region of the page using an
action mapping on the node, but I also need that according to a click on a
folder on the right pane, the tree opens on the left pane the clicked folder
(in a similar fashion to all file explorers where there´s some sort of
bidirectional listener mechanism between both panes).

 

3.	Finally, if anyone has a reference to some more examples on the use
of this component and documentation please let me know, ´cause I´m a little
scarce on docs and examples (So far I have just checked the faces wiki)

 

Regards to all,

Jorge Vásquez

 

 


Mime
View raw message