Duplication nodes in Treetable with a self referencing table.

When you make a treetable over employees table, typical relation Employees-Manager for HR schema.
You see duplicate nodes as see in next image.

treeduplicateYou can delete this duplication, making a viewcriteria with the condition managerid is null



ADF tree table with VO in Read Only

When we work with ViewObject  Read Only (sql based) is important have a key attribute/s in  our VO.
The other day, I worked in a adf treetable with VO RO, and when I disclosed a child in a tree I got this error:

java.lang.IllegalStateException: ADFv: Not inside a container.
at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.exitContainer(FacesCtrlHierBinding.java:673)

The problem was that VO don’t have a Key attribute. When the VO is made upon the Entity, keys are set automatically from database , but if we used a read-only VO based on the query, we must check a key attributes

ADF Tree Table Editable

In this post explain how to put input text field inside adf tree table. In the same tree we will have a readonly fields  and editable fields.

See next image:

<af:treeTable value="#{bindings.LocationsView1.treeModel}" var="node"
selectionListener="#{bindings.LocationsView1.treeModel.makeCurrent}" rowSelection="single"
id="tt1" styleClass="AFStretchWidth">
<f:facet name="nodeStamp">
<af:column id="c0">
<af:outputText value="#{node.City}" id="ot1"/>
<f:facet name="pathStamp">
<af:outputText value="#{node}" id="ot5"/>
<af:column id="c7" headerText="Departments">
<af:outputText value="#{node.DepartmentName}" id="ot6"/>
<af:column id="c3" headerText="Employees">
<af:inputText value="#{node.EmployeeId}"/>
<af:column id="c4" headerText="Employees">
<af:inputText value="#{node.Email}"/>