sventon subversion web client - http://www.sventon.org
[show recent changes]
 
  Help
HEAD
Rev: 28237 - http://anonsvn.icesoft.org/repo / icefaces2 / scratchpads / patches / EmnosBuild / icefaces / compat / components / src / main / java / com / icesoft / faces / component / tree / TreeRenderer.java
Unified Diff View - TreeRenderer.java
/icefaces2/scratchpads/patches/EmnosBuild/icefaces/compat/components/src/main/java/com/icesoft/faces/component/tree/TreeRenderer.java @ revision 28236
/icefaces2/scratchpads/patches/EmnosBuild/icefaces/compat/components/src/main/java/com/icesoft/faces/component/tree/TreeRenderer.java @ revision 28237
@@ -129,8 +129,7 @@         validateParameters(facesContext, uiComponent, Tree.class);         Tree treeComponent = (Tree) uiComponent; -        TreeModel treeModel = (TreeModel) uiComponent -                .getValueBinding("value").getValue(facesContext); +         if (treeComponent.getChildCount() != 1) {             throw new MalformedTreeTagException( @@ -138,9 +137,7 @@                             treeComponent.getChildCount() + "]");         } -        if (treeModel == null) { -            return; -        } +         // set up form fields @@ -203,21 +200,20 @@         DOMContext domContext =                 DOMContext.getDOMContext(facesContext, uiComponent); -        TreeModel treeModel = (TreeModel) uiComponent -                .getValueBinding("value").getValue(facesContext); +        if (!(uiComponent instanceof Tree)) { +            throw new InvalidComponentTypeException("Expecting a Tree"); +        } +        Tree tree = (Tree) uiComponent; +        boolean hideRootNode; +        hideRootNode = isHideRootNode(tree); +        TreeModel treeModel = tree.getModel(); +        if (treeModel == tree.getDummyModel()) hideRootNode = true;         DefaultMutableTreeNode treeComponentRootNode =                 (DefaultMutableTreeNode) treeModel.getRoot();         Element rootNode = (Element) domContext.getRootNode();         com.icesoft.faces.component.tree.TreeNode treeNode =                 (TreeNode) (uiComponent).getChildren().get(0); -        boolean hideRootNode; -        if (uiComponent instanceof Tree) { -            hideRootNode = isHideRootNode((Tree) uiComponent); -        } else { -            throw new InvalidComponentTypeException("Expecting a Tree"); -        } - -        encodeParentAndChildNodes(facesContext, (Tree) uiComponent, +        encodeParentAndChildNodes(facesContext, tree,                 (DefaultMutableTreeNode) treeModel.getRoot(),                 hideRootNode, rootNode, treeComponentRootNode,                 treeNode);


feed icon

sventon 2.5.1