You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by FSchaare <fs...@htp-tel.de> on 2006/03/15 21:57:50 UTC
Tree2 Link Problems
Hi,
i'm trying to understand the tree2 component, which is a bit difficult
for me.
I have the tree2 component working in the left frame of a frameset. When
the user hits a document node, a refering URL should be loaded in the
right frame. How do i do that with tree2 ?
I store the URL information in node.id. Is that the correct place for it ?
Is the any Documentation about the tree2 component ?
thanks for your answers.
Re: Tree2 Link Problems
Posted by Nicklas Karlsson <ni...@gmail.com>.
> The rendered link always points to '#', so where is that set and how can
> i change it ???
>
Hmm, I think the # is used as a dummy to allow for the JSF operations. One
option might be to have have the facet render onclick-javascript or have the
recieving bean render some <script> content.
Re: Tree2 Link Problems
Posted by FSchaare <fs...@htp-tel.de>.
Nicklas Karlsson schrieb:
> The myfaces example contains tree2-stuff too, I suggest you start there.
Yes, i reviewed the tree2 examples already, but i didnĀ“t get the link
mechanism right now.
The document-facet is rendered as follows:
<f:facet name="document">
<h:panelGroup>
<h:commandLink immediate="true" styleClass="#{t.nodeSelected ?
'documentSelected':'document'}" actionListener="#{t.setNodeSelected}">
<t:graphicImage value="images/document.png" border="0"/>
<h:outputText value="#{node.description}"/>
<f:param name="docNum" value="#{node.identifier}"/>
</h:commandLink>
</h:panelGroup>
</f:facet>
The node looks like this:
new TreeNodeBase("document", "Example", "http://www.test.com", true));
The rendered link always points to '#', so where is that set and how can
i change it ???
Re: Tree2 Link Problems
Posted by Nicklas Karlsson <ni...@gmail.com>.
> I have the tree2 component working in the left frame of a frameset. When
> the user hits a document node, a refering URL should be loaded in the
> right frame. How do i do that with tree2 ?
>
> I store the URL information in node.id. Is that the correct place for it ?
>
> Is the any Documentation about the tree2 component ?
>
> thanks for your answers.
>
the named facet in the JSP page determines how the node is rendered, you
could have a commandlink with the target set to the
recieving frame and the node id could be placed in a param to that
commandlink. Depending on what the recieving end does with the payload
it could be anything (e.g an object id to load).
The myfaces example contains tree2-stuff too, I suggest you start there.