myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger (JIRA)" <>
Subject [jira] Commented: (MYFACES-760) Tree2 setLeaf(false) error
Date Tue, 08 Nov 2005 16:34:23 GMT
    [ ] 

Mike Kienenberger commented on MYFACES-760:

Andrew, if it's facelets-related, it's most likely that the Tree2 Tag file is doing something
other than just pass-through assignment of attribute values to the component.   If that's
the case, you'll need to write a facelets TagHandler which imitates the custom behavior of
the Tree2 Tag file.

I've taken a look at org.apache.myfaces.custom.tree2.TreeTag, and it seems mostly straight-forward.
 However, the attribute names specified on the tag are getting converted to an unusual attribute
name value on the component.

    public static final String SHOW_NAV                    = "org.apache.myfaces.tree2.SHOW_NAV";
    public static final String SHOW_LINES                  = "org.apache.myfaces.tree2.SHOW_LINES";
    public static final String CLIENT_SIDE_TOGGLE          = "org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE";
    public static final String SHOW_ROOT_NODE              = "org.apache.myfaces.tree2.SHOW_ROOT_NODE";
    public static final String PRESERVE_TOGGLE             = "org.apache.myfaces.tree2.PRESERVE_TOGGLE";

It sure seems to me that it'd work a lot better if someone simply changed the map attribute
names so that they matched the attribute names on the tag.   Then non-JSP ViewHandlers should
be able to automatically set the attributes without the need for a custom TagHandler.

I think that's what's being said in this thread:

However, if they aren't going to be changed, then you need to write a facelets tag handler
that translates from "showNav" to "org.apache.myfaces.tree2.SHOW_NAV" using the component.getAttributes()

The facelets documentation shows an example of "renaming" an attribute at the following URL.

> Tree2 setLeaf(false) error
> --------------------------
>          Key: MYFACES-760
>          URL:
>      Project: MyFaces
>         Type: Bug
>   Components: Tomahawk
>     Versions: 1.1.0
>  Environment: Tested in JBoss 4.0.3 with Seam
>     Reporter: Andrew Efremov
>     Assignee: sean schofield

> when trying to add nodes to tree2 
> TreeNodeBase tree = new TreeNodeBase("document", node.getName(), node.getId().toString(),
> result node have tree.isLeaf() == true;
> the same is when you trying explicitly set Leaf 
> tree.setLeaf(false);
> result node have tree.isLeaf() == true;

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message