This content has been marked as final.
Show 3 replies
-
1. Re: Trinidad Tree + Seam Action Bean
mikepkp17 Jan 10, 2007 12:16 PM (in response to mikepkp17)I forgot: there is no exception at all, so I cannot provide a stacktrace ;-)
-
2. Re: Trinidad Tree + Seam Action Bean
pmuir Jan 11, 2007 4:40 AM (in response to mikepkp17)I have this working (for a treetable at least). I used a facelets function:
<tr:treeTable value="#{my:asRootedTree(value)}">...
public class Utils { private static TreeModel asTree(Object tree, boolean createRoot) { if (createRoot && tree instanceof Collection) { TreeRoot root = new TreeRoot((Collection) tree); return new ChildPropertyTreeModel(root, "children"); } else { return new ChildPropertyTreeModel(tree, "children"); } } public static TreeModel asTree(Object root) { return asTree(root, false); } public static TreeModel asRootedTree(Object root) { return asTree(root, true); } public static class TreeRoot { private Collection<?> children; public TreeRoot(Collection<?> children) { this.children = children; } public Collection<?> getChildren() { return children; } public String getType() { return "root"; } } }
N.B. These method can create a singly rooted tree from a list (with a dummy root) or take a single object as the root node.
and wired it up using my.taglib.xml. value can now be a Seam outjected list.