2 Replies Latest reply: Mar 4, 2013 3:39 PM by 679254 RSS

    Hierarchy Viewer difference in behaviour between ADF 11.1.1.5 & 11.1.1.6

    679254
      Hi All,

      We are having some problems with the Hierarchy Viewer and we were hoping that someone might be able to shed some light on this issue.

      In ADF 11.1.1.5 we have used the attribute displayLevelsChildren which shows how many levels of children would be displayed (if those levels are available of course). We have assigned a value to a select one choice that would set those levels and allow for our user to customise this value and see the levels on right hand side.

      You can see the behaviour that I am referring to in the following demo:

      http://jdevadf.oracle.com/adf-richclient-demo/faces/feature/hv/hvGroupNode.jspx

      I know that this is an 11.1.2, but this has been the same demo for quite a while, when you change the Show Level on the left, the hierarchy viewer gets updated.

      I have created a simple app that illustrates the problem, and when I run it under 11.1.1.5 it performs as expected, while when we run it on 11.1.1.6 it doesn't refresh the levels

      Versions
      Build JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013
      Build JDEVADF_11.1.1.6.0_GENERIC_111205.1733.6192.1

      The code is below

      This is the "dataBean" which is a pageFlowScope.
      package au.callista.sms.sr.view;
      
      import java.util.ArrayList;
      import java.util.List;
      
      import org.apache.myfaces.trinidad.model.ChildPropertyTreeModel;
      import org.apache.myfaces.trinidad.model.TreeModel;
      
      public class DataBean {
      
           private TreeModel dataModel;
      
           public DataBean() {
                super();
                DataNode grandfather = new DataNode("Big daddy");
      
                DataNode father1 = new DataNode("Daddy 1");
                DataNode son1 = new DataNode("Son 1");
                DataNode daughter1 = new DataNode("Daughter 1");
                father1.addChild(son1);
                father1.addChild(daughter1);
      
                DataNode father2 = new DataNode("Daddy 2");
                DataNode son2 = new DataNode("Son 2");
                DataNode daughter2 = new DataNode("Daughter 2");
                father2.addChild(son2);
                father2.addChild(daughter2);
      
                DataNode father3 = new DataNode("Daddy 3");
                DataNode son3 = new DataNode("Son 3");
                DataNode daughter3 = new DataNode("Daughter 3");
                father3.addChild(son3);
                father3.addChild(daughter3);
      
                grandfather.addChild(father1);
                grandfather.addChild(father2);
                grandfather.addChild(father3);
                
                dataModel = new ChildPropertyTreeModel(grandfather, "children");
           }
      
           public void setDataModel(TreeModel dataModel) {
                this.dataModel = dataModel;
           }
      
           public TreeModel getDataModel() {
                return dataModel;
           }
      
           public class DataNode {
      
                private String title;
                private List<DataNode> children;
      
                public DataNode(String title) {
                     this.title = title;
                     children = new ArrayList<DataNode>();
                }
      
                public void addChild(DataNode child) {
                     this.children.add(child);
                }
      
                public List<DataNode> getChildren() {
                     return children;
                }
                
                public String toString() {
                     return title;
                }
           }
      }
      And below is the jspx page
      <?xml version='1.0' encoding='UTF-8'?>
      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces">
        <jsp:directive.page contentType="text/html;charset=UTF-8"/>
        <f:view>
          <af:document id="d1">
            <af:form id="f1">
              <af:panelSplitter id="ps1">
                <f:facet name="first">
                  <af:panelGroupLayout id="pgl3">
                    <af:selectOneChoice label="Show Levels"
                                        value="#{pageFlowScope.levels}" id="soc1"
                                        autoSubmit="true"
                                        valuePassThru="true">
                      <af:selectItem label="Show No level" value="#{0}" id="si1"/>
                      <af:selectItem label="Show 1 level" value="#{1}" id="si4"/>
                      <af:selectItem label="Show 2 level" value="#{2}" id="si3"/>
                      <af:selectItem label="Show 3 level" value="#{3}" id="si2"/>
                    </af:selectOneChoice>
                    <af:outputText value="#{pageFlowScope.levels}" id="ot1"
                                   partialTriggers="soc1"/>
                  </af:panelGroupLayout>
                </f:facet>
                <f:facet name="second">
                  <dvt:hierarchyViewer id="hierarchyViewer1" layout="hier_vert_top"
                                       inlineStyle="width:100%;height:600px;"
                                       value="#{pageFlowScope.dataBean.dataModel}"
                                       var="node" partialTriggers="::soc1"
                                       displayLevelsChildren="#{pageFlowScope.levels}">
                    <dvt:link linkType="orthogonalRounded" id="l1"/>
                    <dvt:node width="100" height="100" id="n1">
                      <f:facet name="zoom100">
                        <af:panelGroupLayout layout="vertical"
                                             inlineStyle="width:100%;height:100%;padding:5px"
                                             id="pgl2">
                          <af:panelGroupLayout layout="horizontal" id="pgl1">
                            <af:panelGroupLayout layout="vertical" id="pgl4">
                              <af:outputText value="#{node}"
                                             inlineStyle="font-weight:bold;font-size:20px;color:#383A47"
                                             id="ot2"/>
                            </af:panelGroupLayout>
                          </af:panelGroupLayout>
                        </af:panelGroupLayout>
                      </f:facet>
                    </dvt:node>
                  </dvt:hierarchyViewer>
                </f:facet>
              </af:panelSplitter>
            </af:form>
          </af:document>
        </f:view>
      </jsp:root>
      Looking forward to your response.

      Regards,
      Younis Al-Rawi

      Edited by: Younis Al-Rawi on 4/03/2013 08:58