The blog for hints & tips about Oracle Application Development Framework and Mobile Application Framework

How-to determine the ADF tree node type using EL

Frank Nimphius
Master Principal Product Manager
Creating an ADF tree in ADF produces an entry similar to this in the PageDef file of the view.
<tree IterBinding="AllCountriesIterator" id="AllCountries">
      DefName="oracle.summit.model.views.CountryVO" Name="AllCountries0">

       <Item Value="Country"/>
    <Item Value="CustomerVO"/>
      DefName="oracle.summit.model.views.CustomerVO" Name="AllCountries1"

        <Item Value="Id"/>
        <Item Value="Name"/>

Notice the DefName attribute on each node containing a reference to the actual View Object instance used to render a specific node.

With this information you can now use EL to render the tree nodes differently. For example, the page source below renders the node as a command link if the node presents a customer. For Countries, the node is simply rendered as an output text.
<af:tree value="#{bindings.AllCountries.treeModel}" var="node" ...>
  <f:facet name="nodeStamp">
    <af:group id="g1">
      <af:commandLink id="cl4" text="#{node}"                                                                            
                 rendered="#{node.hierTypeBinding.viewDefName == 
<af:outputText id="ot4" value="#{node}"                                                                              
               rendered="#{node.hierTypeBinding.viewDefName ==
The EL expression  #{node.hierTypeBinding.viewDefName} returns the name of the node type, which in ADF is the absolute name of the collection instance rendering the node.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.