Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.ui.collection
Class DataObjectListNodeList

java.lang.Object
  |
  +--oracle.cabo.ui.collection.UINodeListProxy
        |
        +--oracle.cabo.ui.collection.DataObjectListNodeList
All Implemented Interfaces:
java.lang.Cloneable, UINodeList

public class DataObjectListNodeList
extends UINodeListProxy

DataObjectListNodeList is one way for developers to databind the number of children of a bean, and the contents of each child. When set, the bean will render all the children in the UINodeList for each DataObject in the provided DataObjectList. For each pass, the RenderingContext will automatically return the correct DataObject from RenderingContext.getCurrentDataObject().

Unlike the Marlin 1.0 "childData" feature, this will work pervasively on any node type, because it requires no special support from the bean renderer at all.

A DataObjectListNodeList can either contain a single UINode or an entire UINodeList. It can pull the DataObjectList either from an explicitly set instance or from a BoundValue.

Example:

A client wants to provide a single BreadCrumbsBean that will display the full series of bread crumbs off a single source of data. First, set up a DataObjectList. For real-world code, you might implement the (simple!) DataObjectList interface from scratch to communicate directly with your data store, but here's a hardcoded example:

 private DataObjectList _getBreadCrumbsSource()
 {
   String[] titles = {"Home", "Shopping", ... };
   String[] urls   = {"http:...", "...", ... };
   DataObject[] objects = new DataObject[titles.length];

  // Build one DataObject per child
  for (int i = 0; i < titles.length; i++)
  {
    DictionaryData dd = new DictionaryData();
    dd.put("title", titles[i]);
    dd.put("url", urls[i]);
    objects[i] = dd;
  }

   // Create a DataObjectList for the whole group
  return new ArrayDataSet(objects);
 }
 
Second, build up the BreadCrumbsBean, using a DataObjectListNodeList pointing it at a single LinkBean and the DataObjectList you just created.
  private UINode _getDataboundBreadCrumbs()
  {
    // Create the link that will be used to display each
    // "crumb".  Bind the attributes of each
    LinkBean link = new LinkBean();
    link.setTextBinding("title");
    link.setDestinationBinding("url");

    // In a real application, you'd probably use a BoundValue
    // that returns a DataObjectList, instead of setting the
    // DataObjectList directly.
    UINodeList nodeList =
              new DataObjectListNodeList(link,
                                         _getBreadCrumbsSource());

    BreadCrumbsBean crumbs = new BreadCrumbsBean();
    crumbs.setIndexedNodeList(nodeList);
 
    // And done!
    return crumbs;
  }


Constructor Summary
DataObjectListNodeList(BoundValue boundData)
          Creates an empty DataObjectListNodeList.
DataObjectListNodeList(DataObjectList childData)
          Creates an empty DataObjectListNodeList bound to a DataObjectList.
DataObjectListNodeList(UINode baseNode, BoundValue boundData)
          Creates a DataObjectListNodeList wrapping an single UINode.
DataObjectListNodeList(UINode baseNode, DataObjectList childData)
          Creates a DataObjectListNodeList wrapping a single node and pulling its data from an explicitly set DataObjectList.
DataObjectListNodeList(UINodeList baseNodes, BoundValue boundData)
          Creates a DataObjectListNodeList wrapping an entire UINodeList.
DataObjectListNodeList(UINodeList baseNodes, DataObjectList childData)
          Creates a DataObjectListNodeList wrapping an entire UINodeList and pulling its data from an explicitly set DataObjectList.
 
Method Summary
 java.lang.Object clone()
          Clones the UINodeList
protected  DataObjectList getDataObjectList(RenderingContext context)
          Returns the DataObjectList to be used.
 UINode getUINode(RenderingContext context, int index)
          Returns the UINode at the specifed index in the UINodeList, given the specified RenderingContext.
protected  UINodeList getUINodeList(RenderingContext context)
           
 int size(RenderingContext context)
          Returns the size of the DataObjectListNodeList; returns (number of contained nodes) * (size of the DataObjectList).
 
Methods inherited from class oracle.cabo.ui.collection.UINodeListProxy
addUINode, addUINode, clearUINodes, removeUINode, setUINode
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataObjectListNodeList

public DataObjectListNodeList(DataObjectList childData)
Creates an empty DataObjectListNodeList bound to a DataObjectList.
Parameters:
childData - a DataObjectList

DataObjectListNodeList

public DataObjectListNodeList(BoundValue boundData)
Creates an empty DataObjectListNodeList.
Parameters:
boundData - a BoundValue that will be used to retrieve the DataObjectList at render time

DataObjectListNodeList

public DataObjectListNodeList(UINode baseNode,
                              DataObjectList childData)
Creates a DataObjectListNodeList wrapping a single node and pulling its data from an explicitly set DataObjectList.

Parameters:
baseNode - a single node
childData - a DataObjectList

DataObjectListNodeList

public DataObjectListNodeList(UINodeList baseNodes,
                              DataObjectList childData)
Creates a DataObjectListNodeList wrapping an entire UINodeList and pulling its data from an explicitly set DataObjectList.

Parameters:
baseNodes - a list of UINodes to wrap
childData - a DataObjectList

DataObjectListNodeList

public DataObjectListNodeList(UINode baseNode,
                              BoundValue boundData)
Creates a DataObjectListNodeList wrapping an single UINode.

Parameters:
baseNode - a single node
boundData - a BoundValue that will be used to retrieve the DataObjectList at render time

DataObjectListNodeList

public DataObjectListNodeList(UINodeList baseNodes,
                              BoundValue boundData)
Creates a DataObjectListNodeList wrapping an entire UINodeList.

Parameters:
baseNodes - a list of UINodes to wrap
boundData - a BoundValue that will be used to retrieve the DataObjectList at render time
Method Detail

size

public int size(RenderingContext context)
Returns the size of the DataObjectListNodeList; returns (number of contained nodes) * (size of the DataObjectList).
Overrides:
size in class UINodeListProxy

getUINode

public UINode getUINode(RenderingContext context,
                        int index)
Description copied from interface: UINodeList
Returns the UINode at the specifed index in the UINodeList, given the specified RenderingContext.
Overrides:
getUINode in class UINodeListProxy

clone

public java.lang.Object clone()
Description copied from interface: UINodeList
Clones the UINodeList
Overrides:
clone in class UINodeListProxy

getDataObjectList

protected DataObjectList getDataObjectList(RenderingContext context)
Returns the DataObjectList to be used.

getUINodeList

protected UINodeList getUINodeList(RenderingContext context)
Overrides:
getUINodeList in class UINodeListProxy

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.