Cannot sort child rows in multilevel tree table

Hi,
I originally hijacked a two-year-old forum thread that was vaguely similar to my issue, but a kind forum moderator split my post away
(and deleted my other hijack post asking this same question)
so that my inquiry might be viewable on its own.
Hopefully someone can pay attention to my issue instead of getting it confused with those other old forum threads.
So, here we go ...
Is sorting in a treeTable at a particular level possible? Just want to let you I have tried the following approaches to do this. But it dis not work for me.
I have tree table with 2 levels. I am trying to sort the child rows based on its column say "Display Sequence".
User can type in number in this column which contains input text. On value change event of the this field, all the
child rows in the level 2 need to be sorted. This needs to be done without committing the data. On commit it works,
because it sorts based on order by clause. I want the child rows to be sorted on value change event. Following
various approaches I tried.
TreeModel tModel = (TreeModel)treeTable.getValue();
SortCriterion sortCriterion = new SortCriterion("DisplaySequence",true);
List<SortCriterion> sortCriteriaList = new ArrayList<SortCriterion>();
sortCriteriaList.add(sortCriterion);
tModel.setSortCriteria(sortCriteriaList);
The above code does not work, As "DisplaySequence" is not available in the parent view object.
Here is approach no 2
JUCtrlHierBinding treeTableBinding = null;
JUCtrlHierNodeBinding nodeBinding = null;
JUCtrlHierNodeBinding parentNodeBinding = null;
JUCtrlHierTypeBinding nodeHierTypeBinding = null;
Key rowKey;
Object dispSeqObj;
Number displaySequence = null;
Map<Key,Number> keyValueMap = null;
Set<Key> emptyValueKeySet = null;
Map<Key,Number> sortedKeyValueMap = null;
DCIteratorBinding target = null;
Iterator iter = null;
int rowIndex = 1;
RowSetIterator rsi = null;
Row currentRow = null;
Row row = null;
RowKeySet selectedRowKey = lookupTreeTable.getSelectedRowKeys();
Iterator rksIterator = selectedRowKey.iterator();
if (rksIterator.hasNext()) {
List key = (List)rksIterator.next();
System.out.println("key :"+key);
treeTableBinding = (JUCtrlHierBinding) ((CollectionModel)lookupTreeTable.getValue()).getWrappedData();
nodeBinding = treeTableBinding.findNodeByKeyPath(key);
parentNodeBinding = nodeBinding.getParent();
//rsi = nodeBinding.getParentRowSetIterator();
rsi = parentNodeBinding.getChildIteratorBinding().getRowSetIterator();
keyValueMap = new LinkedHashMap<Key,Number>();
emptyValueKeySet = new LinkedHashSet<Key>();
// Gets the DisplaySequence by iterating through the child rows
while(rsi.hasNext()) {
if(rowIndex==1)
row = rsi.first();
else
row = rsi.next();
rowKey = row.getKey();
dispSeqObj = row.getAttribute("DisplaySequence");
if(dispSeqObj!=null && dispSeqObj instanceof Number) {
displaySequence = (Number)dispSeqObj;
keyValueMap.put(rowKey, displaySequence);
}else {
emptyValueKeySet.add(rowKey);
rowIndex++;
rowIndex = 0;
// Sort the numbers using comparator
DisplaySequenceComparator dispSeqComparator = new DisplaySequenceComparator(keyValueMap);
sortedKeyValueMap = new TreeMap<Key,Number>(dispSeqComparator);
sortedKeyValueMap.putAll(keyValueMap);
rsi.reset();
nodeHierTypeBinding = nodeBinding.getHierTypeBinding();
System.out.println("nodeHierTypeBinding :"+nodeHierTypeBinding);
String expr = nodeHierTypeBinding.getTargetIterator();
if (expr != null) {
Object val = nodeBinding.getBindingContainer().evaluateParameter(expr, false);
if (val instanceof DCIteratorBinding) {
target = ((DCIteratorBinding)val);
ViewObject targetVo = target.getViewObject();
System.out.println("targetVo :"+targetVo);
targetVo.setAssociationConsistent(true);
//ri = target.findRowsByKeyValues(new Key[]{rowData.getRowKey()});
rsi = parentNodeBinding.getChildIteratorBinding().getRowSetIterator();
//rsi = nodeBinding.getParentRowSetIterator();
// Rearrange the tree rows by inserting at respective index based on sorting.
ViewObject vo = nodeBinding.getViewObject();
iter = sortedKeyValueMap.keySet().iterator();
while(iter.hasNext()) {
currentRow = rsi.getRow((Key)iter.next());
rsi.setCurrentRow(currentRow);
rsi.setCurrentRowAtRangeIndex(rowIndex);
//rsi.insertRowAtRangeIndex(rowIndex, currentRow);
rowIndex++;
iter = emptyValueKeySet.iterator();
while(iter.hasNext()) {
currentRow = rsi.getRow((Key)iter.next());
rsi.setCurrentRow(currentRow);
rsi.setCurrentRowAtRangeIndex(rowIndex);
//rsi.insertRowAtRangeIndex(rowIndex, currentRow);
rowIndex++;
rsi.closeRowSetIterator();
AdfFacesContext.getCurrentInstance().addPartialTarget(treeTable);
private class DisplaySequenceComparator implements Comparator {
Map<Key,oracle.jbo.domain.Number> dispSeqMap = null;
public DisplaySequenceComparator(Map<Key,oracle.jbo.domain.Number> dispSeqMap) {
this.dispSeqMap = dispSeqMap;
public int compare(Object a, Object b) {
Key key1 = (Key)a;
Key key2 = (Key)b;
oracle.jbo.domain.Number value1 = dispSeqMap.get(key1);
oracle.jbo.domain.Number value2 = dispSeqMap.get(key2);
if(value1.getValue() > value2.getValue()) {
return 1;
} else if(value1.getValue() == value2.getValue()) {
return 0;
} else {
return -1;
In the above code I tried to perform sorting of DisplaySequence values using comparator, then tried to rearrange
nodes or rows based on sort resurts. But rsi.insertRowAtRangeIndex(rowIndex, currentRow) give
DeadViewException...unable to find view reference. While setting current row also does not work.
Approach 3.
DCIteratorBinding iter1 =
bindings.findIteratorBinding("childIterator");
iter1.executeQuery();
SortCriteria sc = new SortCriteriaImpl("DisplaySequence",false);
SortCriteria [] scArray = new SortCriteria[1];
scArray[0] = sc;
iter1.applySortCriteria(scArray);
Any help in Sorting Child nodes ADF treeTable is appreciated. Thanks in Advance.
Abhishek

Hi Frank,
Thanks for your reply. I have tried similar approach for sorting tree table child rows based on user specified number and it works. But there is a limitation for this. This sorting works only for read only/transient view object. For updatable view object after sorting, data cannot be saved or updated, as it cannot find the rowid. Here is what I tried
In the ParentViewImpl class,
1. overrode the method createViewLinkAccessorRS, so that this method is forcefully executed.
@Override
protected ViewRowSetImpl createViewLinkAccessorRS(AssociationDefImpl associationDefImpl,
oracle.jbo.server.ViewObjectImpl viewObjectImpl,
Row row,
Object[] object) {
ViewRowSetImpl viewRowSetImpl = super.createViewLinkAccessorRS(associationDefImpl, viewObjectImpl, row, object);
return viewRowSetImpl;
2. Added the following method, which will be invoked on valueChange of DisplaySequence in child row. Expose this method through client interface. This method accept a parameter i.e. parent row key of the child row.
public void sortChildRecords(Key parentKey) {
ViewObject viewObject = null;
String type = null;
if(parentKey==null) {
Row [] row = this.findByKey(parentKey, 1);
RowSet rowSet = (RowSet)row[0].getAttribute("ChildVO");
viewObject = rowSet.getViewObject();
viewObject.setSortBy("DisplaySequence asc");
}else {
Row row = getCurrentRow();
RowSet rowSet = (RowSet)row.getAttribute("ChildVO");
viewObject = rowSet.getViewObject();
viewObject.setSortBy("DisplaySequence asc");
this.setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES |
ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
this.executeQuery();
For custom sort, lets say all the numbers should be display first in ascending order, and null or empty values to be display at the end need to override the getRowComparator method in the ChildViewImpl class,
Here is the code for the same
@Override
public Comparator getRowComparator() {
SortCriteria sortCriteria = new SortCriteriaImpl("DisplaySequence",false);
SortCriteria [] sortCriterias = new SortCriteria[1];
sortCriterias[0] = sortCriteria;
return new DisplaySequenceComparator(sortCriterias);
private class DisplaySequenceComparator extends RowComparator {
public DisplaySequenceComparator(SortCriteria [] sortCriterias) {
super(sortCriterias);
public int compareRows(Row row1, Row row2) {
Object dispSeqObj1;
Object dispSeqObj2;
Number dispSeq1 = null;
Number dispSeq2 = null;
boolean compareRow1 = true;
boolean compareRow2 = true;
if(row1!=null) {
dispSeqObj1 = row1.getAttribute("DisplaySequence");
if(dispSeqObj1!=null && dispSeqObj1 instanceof Number) {
dispSeq1 = (Number)dispSeqObj1;
}else {
compareRow1 = false;
if(row2!=null) {
dispSeqObj2 = row2.getAttribute("DisplaySequence");
if(dispSeqObj2!=null && dispSeqObj2 instanceof Number) {
dispSeq2 = (Number)dispSeqObj2;
}else {
compareRow2 = false;
if(compareRow1 && compareRow2) {
if(dispSeq1.getValue() > dispSeq2.getValue()) {
return 1;
} else if(dispSeq1.getValue() == dispSeq2.getValue()) {
return 0;
} else {
return -1;
if(!compareRow1 && compareRow2)
return 1;
if(compareRow1 && !compareRow2)
return -1;
return 0;
The above solution works properly, and sorts the child tree rows. But while saving the changes, update fails. I also came to know that in-memory sorting is applicable to read-only/transient view objects from some blogs and also mentiond in this link http://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcadvvo.htm
Is there any way that updatable view objects can be sorted and saved as well?
Thanks,
Abhishek
Edited by: 930857 on May 2, 2012 7:12 AM

Similar Messages

  • How to add a button in the child node of the Tree Table?

    Hi All,
    I am having a requirement to create a tree table and it should have a delete button to each child node (screenshot attached).
    Can anyone provide me a sample for how to implement this.
    Thanks in Advance
    Aravindh

    Hi Aravindhan,
    Try something like this:
    var ttDesvios = new sap.ui.table.TreeTable();
      var cbDesviacion = new sap.ui.commons.CheckBox();
      ttDesvios.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Col1"}),
      template: new sap.ui.commons.Label({text: "Info"}),
      width: "50px",
      ttDesvios.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Action"}),
      template: new sap.ui.commons.Button({text: "Delete"}).bindProperty("visible", "pathPropertyChild", function(value){
              if(value .............){ return true;} //For child
              else{ return false;} //For parent
      width: "160px",
    Regards
    EDIT: Wrong paste code, that's better!

  • Bad performance when iterating/updating the rows of a tree table

    Hello,
    we have a tree table based on a VO and EO (with transient attributes). One of the attribute is a flag.
    The VO is populated with a complex query having many thousands of rows.
    Now, when the user clicks on a parent node, all the children are updated (their flag is set to true) recursively.
    This is really really slow. It might require several minutes, while a similar update via PL/SQL on a real table would required few seconds.
    Is there any way to improve the performance? We have already applied all the tunings on both the EO and VO mentioned in Oracle Documentation, but they had almost no effect:
    - retain viewlink row set iterators
    - query hints
    - Use update batching
    The algorithm we use is the following:
        private void checkTreeNodes(JUCtrlHierNodeBinding node, Boolean check) {
            if (node == null) {
                return;
           TreeVORowImpl nodeRow = (TreeVORowImpl)node.getRow();
            if (nodeRow != null) {
                    nodeRow.setFlag(check);
            List<JUCtrlHierNodeBinding> children = null;
            if (!nodeRow.getLevel().equals("4"))  // no more than 4 levels
                children = node.getChildren();
            if (children != null) {
                for (JUCtrlHierNodeBinding _node : children) {
                    checkTreeNodes(_node, check);
        }

    Thanks for you answer.
    I am trying to move the logic in a method of the AM. But I have an exception (jdev 11.1.2.1):
        public void checkTreeNodes(TreeVORowImpl node, Boolean check, int level) {
            if (node == null)
                return;
            node.setFlag(check);
            if (level >= 4)
                return;
            Key key = new Key(new String[] { node.getId() }); // Id is the primary Key
            // By debugging via System.out.println, the code stops here:
            RowIterator rowIt = getMyVO().findByAltKey("ParentId", key , -1, false); // children have ParentId = Id
            while (rowIt.hasNext()) {
                TreeVORowImpl row = (TreeVORowImpl)rowIt.next();
                checkTreeNodes(row, check, level + 1);
        }findByAltKey gives the following exception (since it's called from the UI by getting the AM from DataControl):
    oracle.jbo.InvalidObjNameException: JBO-25005: [...]
         at oracle.adf.model.binding.DCBindingContainerState.validateStateFromString(DCBindingContainerState.java:573)
         at oracle.adf.model.binding.DCBindingContainerState.validateStateFromString(DCBindingContainerState.java:504)
         at oracle.adf.model.binding.DCBindingContainerState.validateToken(DCBindingContainerState.java:684)
    Do you see anything wrong or not efficient?
    Thanks.

  • GetSelectedRowKeys() returns more than one on Single Selection Tree Table

    Hi,
    I found that this issue occurring after PS3 (I think.)
    I have a tree table component, which allows single row selection. There is a listener on a column of the tree table as follows:
    public void listenPackageUnit(ValueChangeEvent valueChangeEvent)
    Object oldKey = getTreeComponent().getRowKey();
    try
    * Retrieve index of selected package unit
    * NOTE: Subtract 1 to remove no selection value. This only
    * needs to be done if attached LOV has No Selection option set.
    if (valueChangeEvent.getNewValue() != null)
    Row row = null;
    String selectedPackageUnit = null;
    int packageUnitIndex = (Integer) valueChangeEvent.getNewValue();
    packageUnitIndex--;
    * Due to the no selection item, we need to prevent search of regular
    * iterator if index is < 0. In this case we know the user selected
    * the no selection (blank) value.
    if (packageUnitIndex >= 0)
    * Using index, determine the value of the selected package unit
    DCIteratorBinding packageUnitsIterator =
    (DCIteratorBinding) PasUiADFUtil.resolveExpression("#{bindings.PackageUnitsIterator}");
    Row newRow =
    packageUnitsIterator.getRowAtRangeIndex(packageUnitIndex);
    selectedPackageUnit = (String) newRow.getAttribute("LookupCode");
    RowKeySet selection = this.getTreeComponent().getSelectedRowKeys();
    if (selection != null && selection.getSize() > 0)
    for (Object facesTreeRowKey: selection)
    this.getTreeComponent().setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData =
    (JUCtrlHierNodeBinding) this.getTreeComponent().getRowData();
    row = rowData.getRow();
    setSelectedLabel((String) row.getAttribute("Label"));
    setSelectedLabelType((String) row.getAttribute("LabelType"));
    row.setAttribute("PackageUnit", selectedPackageUnit);
    getTreeComponent().setRowKey(oldKey);
    finally
    getTreeComponent().setRowKey(oldKey);
    The issue is that getSelectedRowKeys() returns more than one when the user selects a child row in the tree table.
    It seems to be returning the total number counting from the top parent through the child.
    (For example, if the child is the second generation, it returns 2, and if the third generation, it returns 3.)
    This is causing the issue that the method tries to update the attribute of the parent row with a value for the child row. (And it fails, because the attribute is updateable only while new.)
    I remember getSelectedRowKeys() always returned one, the selected child itself, when I coded this around October, 2010.
    Is this a design change after PS3? Why does it return more than one though the tree table is for single selection?
    How can I get around this issue?
    It would be truly appreciated if we can get any quick help, since we are at final testing phase of our product.
    Thank you,
    Tomo

    Hi Vinod,
    I found the solution. Thank you very much for your suggestions. :)
    Now my listenSelection (custom listener of the tree table) looks like below:
    public void listenSelection(SelectionEvent selectionEvent)
    Row currentRow;
    PasUiADFUtil.invokeEL("#{bindings.TransactionLabelTopLevelVO1.collectionModel.makeCurrent}",
    new Class[] { SelectionEvent.class },
    new Object[] { selectionEvent });
    Object oldKey = getTreeComponent().getRowKey();
    try
    if (this.getTreeComponent() != null)
    RowKeySet rks = this.getTreeComponent().getSelectedRowKeys();
    Iterator keys = rks.iterator();
    while (keys.hasNext())
    List key = (List) keys.next();
    this.getTreeComponent().setRowKey(key);
    JUCtrlHierNodeBinding node =
    (JUCtrlHierNodeBinding) this.getTreeComponent().getRowData();
    if (node != null)
    currentRow = node.getRow();
    if (currentRow != null)
    this.setSelectedRow(currentRow);
    setSelectedLabel((String) currentRow.getAttribute("Label"));
    setSelectedLabelType((String) currentRow.getAttribute("LabelType"));
    String shippedItemFlag =
    (String) currentRow.getAttribute("ShippedItemFlagValue");
    if (shippedItemFlag != null && shippedItemFlag.equals("1"))
    setDisableAdd(true);
    else
    setDisableAdd(false);
    finally
    getTreeComponent().setRowKey(oldKey);
    /* Refresh Action menu and buttons */
    RequestContext.getCurrentInstance().addPartialTarget(this.getActionMenu());
    RequestContext.getCurrentInstance().addPartialTarget(this.getToolbar());
    And my tree table is like below:
    <af:treeTable value="#{bindings.TransactionLabelTopLevelVO1.treeModel}"
    var="node" rowSelection="single" id="tt1"
    contentDelivery="immediate" fetchSize="25"
    emptyText="#{bindings.TransactionLabelTopLevelVO1.viewable ? commonFoundationMsgBundle.NO_DATA_TO_DISPLAY : commonFoundationMsgBundle.ACCESS_DENIED}"
    selectionListener="#{pageFlowScope.MaintainTransactionSerialAssociationBean.listenSelection}"
    binding="#{pageFlowScope.MaintainTransactionSerialAssociationBean.treeComponent}"
    summary="#{maintainAssociationUiBundle.CONTAINER_SERIAL_HIERARCHY}">
    <!-- Row Header -->
    The listener is now always getting the currently selected row only.
    Tomo

  • How to highlight a row in tree table - jdev 11.1.2

    Hello:
    Given a key, I want to highlight (select/set currency) the corresponding row in a tree table. I thought the following code would highlight the row in the tree table that corresponds to the key, but nothing is highlighted in the tree table. ie---> treeTable.setSelectedRowKeys(selectedRowKeys); What am I doing wrong? Thanks much.
    public String cb1_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("Next");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    DCBindingContainer bc = (DCBindingContainer) getBindings();
    DCIteratorBinding iter = (DCIteratorBinding) bc.findIteratorBinding("DDF1Iterator");
    RowKeySet selectedRowKeys = new RowKeySetImpl();
    ArrayList list = new ArrayList();
    Row r = iter.getCurrentRow();
    Key k = r.getKey();
    list.add(k);
    selectedRowKeys.add(list);
    treeTable.setSelectedRowKeys(selectedRowKeys);
    AdfFacesContext adfc = AdfFacesContext.getCurrentInstance();
    adfc.addPartialTarget(treeTable);
    }

    Hello:
    Do you mean setting the selectedRowKeys in the setter method of the treeTable in the Request Scoped Managed Bean?
    If that is what you mean, I tried that and there was no change in behavior. (Still does not highlight the correct row in the tree table upon execution of the next method for the bindings) Does anyone have any sample code they can provide that works?
    Thanks for the help.

  • How to insert a row in Tree table which is dragged from the table?

    Hi All,
    I am having a Tree table and a Table in the same page, like below
    Treetable                                         Table
    Item1                                              Subitem12
         Subitem1                                   Subitem13
         Subitem2                                   Subitem14
         Subitem3                                   Subitem15
         Subitem4                                   Subitem16
    Item2                                              Subitem17
         Subitem5                                   Subitem18
         Subitem6                                   Subitem19
         Subitem7                                   Subitem20
         Subitem8                                   Subitem21
    Item3
         Subitem9
         Subitem10
         Subitem11
    The requirement is i need to "drag" a row from the Table and place it under any parent node in the Tree table.
    What i have done is I make the Tree table as ".ui-sortable" and table as a "draggable".
    I am not able to find the position of the dragged item when i dropped it in the Treetable.
    Please provide me a solution.
    Regards,
    Aravindh

    Hello:
    Do you mean setting the selectedRowKeys in the setter method of the treeTable in the Request Scoped Managed Bean?
    If that is what you mean, I tried that and there was no change in behavior. (Still does not highlight the correct row in the tree table upon execution of the next method for the bindings) Does anyone have any sample code they can provide that works?
    Thanks for the help.

  • Selected node in a tree table (via Data Controls and not managed bean)

    I am facing some problems in getting the selected row in a tree table.I have used data controls for creating the tree on the page.
    I have 3 POJO's,ex; Class AB which has a list of Class CD.And Class CD has a list of class EF. (Used for the tree table)
    Now i have a java class, called MyDelegate.java which has a list of AB.I generated data controls off this MyDelegate class and have dropped the ABlist as a tree table (also displaying CD and EF in the tree table).
    It displays fine with nodes of AB,CD (child of AB)and EF(child of CD)
    The tree table is not bound to any managed bean.
    For performing actions on the tree, i create a method - "doSomething() in the delegate class",generate data controls and drop it as a button.
    Inside doSomething(), i need acess to the selected node in the tree (it can be a node of type AB or CD or EF).
    The problem: I always get access to the node of type AB, and not the child nodes no matter what i click in the tree table.
    doSomething(){
    DCBindingContainer dcBindingContainer = (DCBindingContainer)ADFUtil.evaluateEL("#{bindings}");
    DCIteratorBinding dcTreeIteratorBinding = dcBindingContainer.findIteratorBinding("lstABIterator");
    RowSetIterator rowTreeSetIterator = dcTreeIteratorBinding.getRowSetIterator();
    DCDataRow rowTree = (DCDataRow)rowTreeSetIterator.getCurrentRow();
    if (rowTree.getDataProvider() instanceof AB) {
              //do something
              AB selectedAB = (AB)row.getDataProvider();
    } else if (rowTree.getDataProvider() instanceof CD){
              //do something
    } else if (rowTree.getDataProvider() instanceof EF) {
              // do something
    How do i access the "selected child node of the tree table" here in the delegate class method? Pls help.

    Hi Frank,
    Thanks for the response. In my case, i dont have a managed bean, so i am slightly unsure how to do it.
    There is a mention "Note that another way to access the treeTable component at runtime is to search for it in JavaServer Faces UIViewRoot. This latter option allows you to write more generic code and does not require to create a page dependency to a managed bean"
    How do i use this adf view root (without a managed bean) to get hold of the selected row in the tree table. Pls help.
    Thanks.

  • ADF Tree table :  Target Unreachable, identifier 'node' resolved to null

    Hi, we are using a tree table:
    <af:treeTable value="#{bindings.FacilitySummaryVO1.treeModel}"
    var="node"
    emptyText="#{bindings.FacilitySummaryVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
    selectionListener="#{bindings.FacilitySummaryVO1.treeModel.makeCurrent}"
    rowSelection="#{pageFlowScope.facilitySummaryHelper.tableSelectionMode}"
    id="tt1" width="100%" contentDelivery="immediate"
    binding="#{backingBeanScope.facilitySummary.facilityTree}"
    autoHeightRows="#{pageFlowScope.facilitySummaryHelper.tableHeight}"
    columnStretching="column:c6">
    <f:facet name="nodeStamp">
    <af:column id="c8" width="5px" headerText=""></af:column>
    </f:facet>
    <af:column id="c5"
    headerText="#{facilitySummary_rb.COLUMN_LABEL_SELECT}"
    width="40" align="center"
    rendered="#{pageFlowScope.facilitySummaryHelper.showColumnSelect}">
    <af:group id="g1">
    <af:panelLabelAndMessage label="" id="plam1">
    <af:selectBooleanCheckbox text="" autoSubmit="true"
    rendered="#{node.ShowSelectCheckBox}"
    valueChangeListener="#{backingBeanScope.facilitySummary.facilitySelectCheckboxEventListener}"
    label="" id="sbc1"
    value="#{node.bindings.SelectedFacilityLandingPage.inputValue}"/>
    </af:panelLabelAndMessage>
    </af:group>
    </af:column>
    <af:column id="c6"
    headerText="#{facilitySummary_rb.COLUMN_LABEL_FACILITY}">
    <af:group id="g2">
    <af:panelGroupLayout layout="horizontal" id="pgl2">
    <af:spacer width="#{node.IndentationWidth}" height="10"
    id="s2"/>
    <af:commandLink text="" textAndAccessKey="#{node.FacilityName}"
    disabled="#{pageFlowScope.facilitySummaryHelper.itemReadonly}"
    visible="#{(node.NodeType == facilitySummary_rb.ACCOUNT_VALUE)? false : true}"
    actionListener="#{backingBeanScope.facilitySummary.treeExpandDiscloseActionListener}"
    id="cl2">
    <af:image source="#{node.NodeImgPath}" id="i2" shortDesc=""></af:image>
    </af:commandLink>
    <af:spacer width="10" height="10" id="s1"/>
    <af:commandLink text="#{node.FacilityName}"
    textAndAccessKey="#{node.FacilityName}" id="cl1"
    actionListener="#{backingBeanScope.facilitySummary.showDetailsActionListener}"></af:commandLink>
    </af:panelGroupLayout>
    </af:group>
    </af:column>
    <af:column id="c12"
    headerText="#{facilitySummary_rb.COLUMN_LABEL_ACTION}"
    width="110"
    rendered="#{pageFlowScope.facilitySummaryHelper.showColumnAction}">
    <af:selectOneChoice valueChangeListener="#{backingBeanScope.facilitySummary.nodeActionValueChangeListener}"
    value="#{node.bindings.SelectActionValue.inputValue}"
    label=""
    unselectedLabel="#{origination_rb.LBL_IB_UNSELECTED_VALUE}"
    readOnly="#{pageFlowScope.facilitySummaryHelper.itemReadonly}"
    id="soc1" autoSubmit="true">
    <f:selectItems value="#{node.NodeAction ==null? pageFlowScope.facilitySummaryHelper.defaultSelectItems : node.NodeAction}"
    id="si2"/>
    </af:selectOneChoice>
    </af:column>
    </af:treeTable>
    af:selectOneChoice has an option to remove the row in the tree table by clearing the VO and populate new data into it. (with the exception of the removed row)
    The row get removed from the vo and the screen but i got this error Target Unreachable, identifier 'node' resolved to null
    No stack trace got printed in the stack trace.
    It works with jdev/adf 11.1.1.1.4. only with jdev/adf 11.1.1.1.5 (JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013) we're having this error. FacilitySummaryVO doesnt have primary key attribute.
    Data got populated to VO programmatically
    All VO attribute value updatable value is always

    Hi,
    hard to say. Actually the "node" variable reference is only available during tree rendering. So if you have any reference to the "node" variable that is invoked after tree rendering then this would explain the exception
    Frank

  • Synchronize form with self-referencing VO in tree table. POJO Based Model

    Hello. I need your help
    ADF Code Corner sample #32 show how to build a tree table from a self referencing VO:
    [http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples]
    ADF Code Corner document Oracle JDeveloper OTN Harvest 09/2011 by Frank Nimphius show how to build an edit form for the table data and how to synchronize it with the selected row in the tree table:
    [http://www.oracle.com/technetwork/developer-tools/adf/learnmore/sept2011-otn-harvest-508189.pdf]
    This examples are helpful, but i have a problem, i have not a model based on a database, my application datamodel is based in POJO objects, there are no appModules or ViewObjects so I do not know how to reference the tree table target attribute with the edit form iterator.
    Can anyone help me?
    Maybe (i dont know how) i need make a VO and a AppModule that wraps the POJO model ?
    thank you very much

    Hi,
    this should work the same. You create a tree from a POJO Data Control based on your POJO Model. Expose another collection pointing to the same data set and drag it as the form. Use the setting on the tree configuration dialog to set the current row in the tree as the current in the form iterator.
    Frank

  • ADF Issue with Tree Table , Child Row not getting rendered.

    Hi All,
    I am trying to show a single Level Master-Detail Table via ADF Tree Table.
    I have MasterVO : InventoryVO (1 SubInventoryCode)
    DetailVO: SubInventoryVO (n :SubInventoryCode)
    Both VOs are SQL query based VO with bindVariables.
    I have a viewLink between MasterVO and ChildVO (1:n relationship)
    I dragged and drop the MasterVO as a tree Table. I added the Rule in the Tree Binding too.
    I have the Tree table under a Tab , I execute the AM impl method when the Tab is clicked where I set the bindvariables of the MasterVO and ChildVO and execute it.
    when I run the Page , the VO query gets executed but the I am able to see only the MasterVO Datas, and when I click MasterVO ROW , the Table doesnt expand and it doesnt render any ChildVO ROws.
    Please find the Page Definition and Jspx Page Code Below
    Page Definition Code
    <tree IterBinding="ItemsLocatorIterator" id="ItemsLocator">
          <nodeDefinition DefName="xxplp.oracle.adf.items.model.view.ItemsLocatorVO"
                          Name="ItemsLocator0">
            <AttrNames>
              <Item Value="SubinventoryCode"/>
              <Item Value="Openorderqty"/>
              <Item Value="Openwoqty"/>
              <Item Value="Qoh"/>
            </AttrNames>
            <Accessors>
              <Item Value="ItemSubInventoryVO"/>
            </Accessors>
          </nodeDefinition>
          <nodeDefinition DefName="xxplp.oracle.adf.items.model.view.ItemSubInventoryVO"
                          Name="ItemsLocator1">
            <AttrNames>
              <Item Value="Locator"/>
            </AttrNames>
          </nodeDefinition>
        </tree>Jspx Page Code
    <af:treeTable value="#{bindings.ItemsLocator.treeModel}"
                                          var="node"
                                          selectionListener="#{bindings.ItemsLocator.treeModel.makeCurrent}"
                                          rowSelection="single" id="tt2"
                                          styleClass="AFStretchWidth"
                                          rowDisclosureListener="#{backingBeanScope.TabListenerBean.LocationTableRowDisclosureListener}">
                              <f:facet name="nodeStamp">
                                <af:column id="c110">
                                  <af:outputText value="#{node.SubinventoryCode}" id="ot116"/>
                                </af:column>
                              </f:facet>
                              <f:facet name="pathStamp">
                                <af:outputText value="#{node}" id="ot117"/>
                              </f:facet>
                              <af:column id="c111"
                                         headerText="#{bindings.ItemsLocator.hints.Qoh.label}">
                                <af:outputText value="#{node.Qoh}" id="ot118"/>
                              </af:column>
                              <af:column id="column1"
                                         headerText="#{bindings.ItemsLocator.hints.Openorderqty.label}">
                                <af:outputText value="#{node.Openorderqty}"
                                               id="outputText1"/>
                              </af:column>
                              <af:column id="column2"
                                         headerText="#{bindings.ItemsLocator.hints.Openwoqty.label}">
                                <af:outputText value="#{node.Openwoqty}"
                                               id="outputText2"/>
                              </af:column>
                              <af:column id="column3"
                                         headerText="Locator">
                                <af:outputText value="#{node.Locator}"
                                               id="outputText3"/>
                              </af:column>
                            </af:treeTable>

    I was able to find the issue which is causing the problem, both the VOs are SQL Query Based VOs.
    The ChildVO (SubInventoryVO) is has a bindvariable in its Query, which is losing its value when the viewlink accessor query gets appended to it.
    Please find the query below
    SELECT * FROM (SELECT MOTV.ORGANIZATION_CODE, MOTV.SUBINVENTORY_CODE  
    FROM MTL_ONHAND_TOTAL_V MOTV
    WHERE INVENTORY_ITEM_ID = :P_INVENTORY_ITEM_ID) QRSLT  WHERE ORGANIZATION_CODE = :Bind_OrganizationCode Though I am setting the VO query before the Table is rendered, ":P_INVENTORY_ITEM_ID".
    Its Losing its value, when the above whereclause "ORGANIZATION_CODE = :Bind_OrganizationCode " gets appended to it.
    I am thinking to use ExecuteWithParams Operation on SelectionListener method of the Tree Table to set the ":P_INVENTORY_ITEM_ID" bind variable, but I also want the viewLinkAccessor rule also to be applied ..
    Please suggest me how to retain the implicit bindVariable of the Query.

  • Row Selection for second and subsequent level nodes in tree table

    Hi All,
    We have a .jsff page with tree bindings to display a three-level hierarchy tree table.Suppose the hierarchy is
    -> Department
    ->-> Employees
    ->->-> Employee details.
    I have a use case where-in when we add the employee node within a department,the department node must expand and the newly added employee node must be selected.
    In both the cases(for new department or employee), we are following the approach mentioned below:
    1. Get the treeTable Iterator.
    2.Adding the new object to the java ArrayList which is bound to the corresponding level in the tree.
    3.Refreshing the treeTable iterator.
    4.Execute treeTable.setSelectedRowKeys()
    5.Add a partial target to the treetable.
    The issue is that the new employee gets added but the upper-level department node collapses and no selection is performed on the new employee node.
    But when we add a new department node, it gets selected on creation.
    Is there any additional steps to be performed for second-level row selection?

    Hi,
    Thanks for the reply.
    I looked at the code given in sample 61.
    In the sample, a new node is not added dynamically (for ex.either new location or its child nodes.)
    As mentioned in the above post, after adding a new node at a level in our use case, when we perform the refresh of the tree-table's iterator,the selection state of the rows is not shown on the table.
    If the tree-table's iterator is not refreshed and the treeTable.setSelectedRowKeys() is executed, the rows get selected but the subsequent node additions do not show up in the table as the table's iterator is not refreshed.
    Any sample code is available where in both the addition of new node and its selection is performed at the same time?
    Thanks.

  • Rich Tree Table Drop duplicate Row Keys (from different Rich Tables)

    Hello.
    My scenario looks like this:
    Two tables (lets say productTable, and taskTable) as drag sources.
    One Tree Table ( that should have the productTable items as a parent node, and the childNodes would be taskTable items), as a drop target..
    In my test case, I was able to drag a row from a table, and drop it in a Tree Table. I could also program my drop listener in such a way that I could create child nodes. In my case I will only have 1 child node.
    - Parent Node 1
    - Child Node 1
    - Child node 2
    - Child node 3
    - Parent Node 2
    -Child node 4
    Example of my Tables
    Products
    prod1
    prod2
    prod3
    Tasks
    Task1
    Task2
    Task3
    Task4
    If I drag prod1 to the tree table, and then drag task1, to the treetable (on top of the prod1), I can't release the task1. The component will not accept this draggable item. If I drag any other task, other than task1, I can successfully insert this tag as a child node. I think it has something to do with the Row key. I'm using the dataFlavor as:
    <af:dataFlavor flavorClass="org.apache.myfaces.trinidad.model.RowKeySet"
    discriminant="ProductTaskModel"/>
    I think it has something to do with the row key, because if I drag prod2 to the treeTable and then try to put task2 in prod2 I get the same problem. I'm guessing that adf faces rc is generating the same row key for prod and task, and the tree table does not accept the same row key on top of the same row key.
    prod1 - rk=1
    prod2 - rk=2
    prod3 - rk=3
    task1 - rk=1
    task2 - rk=2
    task3 - rk=3
    Does anyone think it has something to do with this ?
    If it does, how can I generate different row keys ?
    Thanks a lot,
    John

    Hi,
    thanks for the testcase. I can reproduce the behavior. I found 2 minor issues in your code that I replied to you in a mail. I'll file a bug against the behavior. Should it turn out not to be a bug but a required coding change then I'll update this post
    Frank

  • Expansion of Child table rows under each master table rows

    Hi,
              I am using JDeveloper 11.1.1.5 version for developing ADF application.
        I need to display a master table rows and its child table rows such that
    When I expand master table row,  I need to display child rows under the master row which is I expanded.
    Like this each master table row should expand its child rows between the next master table row (like ShowDetail or detailStamp)
    So kindly suggest ideas on what can be used to bring out this requirement on page.
    If any links available for reference or guidance , kindly mention it and help me out.
    Thanks,
    Vino

    You can use a tree table for this. A sample you can find at http://andrejusb.blogspot.ch/2009/11/tree-table-component-in-oracle-adf.html
    or  http://dstas.blogspot.ch/2011/11/master-detail-detail-using-tree-table.html
    Timo

  • Problem in executing Child VO having bind parameter for ADF tree table

    In my application i need to show a ADF Tree table which is using two view objects having view links between them
    and the child VO has a bind variable.By clicking on the parent node of the parent VO attribute it showing the right result from the child VO attribute by the view link.
    I have tried to execute the child VO programmatically (In AmImpl) with the bind variable and using ViewCriteria as well
    but both the cases the child vo is not showing the proper result according to the bind variable instead of it is showing all the records on click of the parent node attribute.
    Your help will be appreciated.
    Thanks

    Hello,
    In the same situation I added another relationship to the view link to set the parameter.
    Tricky moment is you have to name your parameter like :Bind_ParamName as view link is setting this kind of parameters (check it in Query tab).

  • Sorting Totals After on rows in a Pivot table

    Hi,
    I need to Sorting Totals After on rows in a Pivot table .
    Can anyone help?
    Thanks

    Try this:
    1) Duplicate your measure column in Criteria.
    2) In the fx window, enter RANK(your_measure_column).
    3) Place this column in the Rows section of your pivot table. Apply ascending sort order.
    4) Hide the column.
    Your Totals (After) column (the sigma sign in the Columns section of your pivot table) willl be sorted.

Maybe you are looking for

  • Replication of Quotation from CRM to ECC

    Hi experts, We are trying to replicate a quotation created in CRM to ECC. We have maintained the same transaction types and item categories in both ECC and CRM. Is there anything else that is required to be done for proper replication?? A CSA BDoc is

  • Using a Vector Art File as a matte for an image collage

    II have a vector art file of a paw print.  I would like to use it with a variety of photos to create a collage.  I have the image files selected and the vector art file sized, but what I can't figure out is how to have the images seen ONLY inside eac

  • Print Preview of particular page issue in SAP script

    Hi all, Kindly help me to resolve the following issue in SAPscript. I have a particular business requirement to preview a particular page in 'n' pages of a SAPscript.  After executing the sapscript calling program, the print window appears, in which

  • AMD card VGA output misaligned since LTS 3.14

    Hi, since the update to Linux LTS 3.14, the VGA output of my AMD graphics card is misaligned (see image below). The graphics card is a Radeon HD 6670 (Turks XT). The digital ports, at least HDMI, are fine though. I do not really know whether it's a c

  • Microphone probably broken but I don't know.

    So I have an IPhone 5c. My problem is Siri doesn't respond to my voice. I've tried it over and over again and nothing happens. Also when I try to record a video on my phone the sound doesn't work. In the video I will be talking but when I playback th