It works great!
Thanks Dennis
 
Edwin
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 12:58 PM
To: MyFaces Discussion
Subject: RE: extending tree2


You don't need to the myFaces source, just the binary distribution.  If you are already using myfaces, then you already have it. The rest is this, Edwin:

1.) Compile the two classes.
2.) Get a tag library descriptor (a .tld file under /WEB-INF/tags is best.), I'll just copy and paste one below.
3.) Look at the post w/ long lines of code, use the xml snippets in your faces configuration.
4.) In JSP, put this at the top
<[EMAIL PROTECTED] prefix="a" uri="yourURN" %>
5.) Use tree3 like this:

<a:tree3 expandAllInit="true" ... />

BTW, expandAllInit is false by default. I've only used this with the 1.0.9 version.  Let me know if you stumble.


<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
    version="2.0">
   
  <description>desc</description>
  <display-name>disp</display-name>
  <tlib-version>1.0</tlib-version>
  <short-name>short</short-name>
  <uri>yourURN</uri>
   
   <!-- tree3 -->
    <tag>
        <name>tree3</name>
        <tag-class>org.apache.myfaces.custom.tree3.TreeTag</tag-class>
        <body-content>JSP</body-content>
        <attribute>
            <name>id</name>
            <required>true</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
            <name>value</name>
            <required>true</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
            <name>var</name>
            <required>false</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
            <name>varNodeToggler</name>
            <required>false</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
            <description>
                Show the "plus" and "minus" navigation icons (default is true.) Value is ignored if
                clientSideToggle is true.
            </description>        
            <name>showNav</name>
            <required>false</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
            <description>Show the connecting lines (default is true.)</description>        
            <name>showLines</name>
            <required>false</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
            <description>Perform client-side toggling of expand/collapse state via _javascript_ (default is true.)</description>        
            <name>clientSideToggle</name>
            <required>false</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
            <description>Include the root node when rendering the tree (default is true.)</description>        
            <name>showRootNode</name>
            <required>false</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
            <description>Expand all nodes the initial time this control is rendered.</description>        
            <name>expandAllInit</name>
            <required>false</required>
            <rtexprvalue>false</rtexprvalue>
        </attribute>
    </tag>    
   
</taglib>

Reply via email to