Hello Sebastein,
Did you have a workaround for the problem you were facing of null child..?
I am also using the MyFaces treeTable component. I have a list of tasks and their subtasks. I want to display task as the root node and sub-tasks as its children.
Following is my jsp page -
<t:dataTable id="taskTable" styleClass="taskTable"
rowClasses="taskTable_Row1,taskTable_Row2" var="task" columnClasses="task_nodeColumn,task_groupColumn,task_weightColumn"
value="#{projectLeaf.tasks}">
<t:column>
<t:tree id="tree" value="#{task.subTaskTree}"
var="treeItem" expandRoot="true">
<t:treeColumn>
<f:facet name="header">
<h:outputText value="Header 2" />
</f:facet>
<h:outputText value="#{treeItem.name}" />
</t:treeColumn>
</t:tree>
</t:column>
<t:column>
<f:verbatim><b>Participants</b><br></f:verbatim>
</t:column>
</t:dataTable>
The bean method is as below -
public DefaultTreeModel getSubTaskTree()
{
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new Task(1,"root"));
DefaultMutableTreeNode a = new DefaultMutableTreeNode(new Task(2, "A"));
root.insert(a);
DefaultMutableTreeNode b = new DefaultMutableTreeNode(new Task(3, "B"));
root.insert(b);
DefaultMutableTreeNode c = new DefaultMutableTreeNode(new Task(4, "C"));
root.insert(c);
DefaultTreeModel treeModel = new DefaultTreeModel(root);
return treeModel;
}
I get the following error
Base is null: task
Wud appreciate your help if you have come across such error or have any idea.
TIA
Nikita
Did you have a workaround for the problem you were facing of null child..?
I am also using the MyFaces treeTable component. I have a list of tasks and their subtasks. I want to display task as the root node and sub-tasks as its children.
Following is my jsp page -
<t:dataTable id="taskTable" styleClass="taskTable"
rowClasses="taskTable_Row1,taskTable_Row2" var="task" columnClasses="task_nodeColumn,task_groupColumn,task_weightColumn"
value="#{projectLeaf.tasks}">
<t:column>
<t:tree id="tree" value="#{task.subTaskTree}"
var="treeItem" expandRoot="true">
<t:treeColumn>
<f:facet name="header">
<h:outputText value="Header 2" />
</f:facet>
<h:outputText value="#{treeItem.name}" />
</t:treeColumn>
</t:tree>
</t:column>
<t:column>
<f:verbatim><b>Participants</b><br></f:verbatim>
</t:column>
</t:dataTable>
The bean method is as below -
public DefaultTreeModel getSubTaskTree()
{
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new Task(1,"root"));
DefaultMutableTreeNode a = new DefaultMutableTreeNode(new Task(2, "A"));
root.insert(a);
DefaultMutableTreeNode b = new DefaultMutableTreeNode(new Task(3, "B"));
root.insert(b);
DefaultMutableTreeNode c = new DefaultMutableTreeNode(new Task(4, "C"));
root.insert(c);
DefaultTreeModel treeModel = new DefaultTreeModel(root);
return treeModel;
}
I get the following error
Base is null: task
Wud appreciate your help if you have come across such error or have any idea.
TIA
Nikita
---------------------------------------------------------------------
Ability is what you're capable of.
Motivation determines what you do.
Attitude determines how well you do it.
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping