|
Oracle UIX API Reference Release 2.1.22.0.0 B12196-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cabo.ui.collection.UINodeListProxy | +--oracle.cabo.ui.collection.DataObjectListNodeList
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.
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 |
public DataObjectListNodeList(DataObjectList childData)
childData
- a DataObjectListpublic DataObjectListNodeList(BoundValue boundData)
boundData
- a BoundValue that will be used
to retrieve the DataObjectList at render timepublic DataObjectListNodeList(UINode baseNode, DataObjectList childData)
baseNode
- a single nodechildData
- a DataObjectListpublic DataObjectListNodeList(UINodeList baseNodes, DataObjectList childData)
baseNodes
- a list of UINodes to wrapchildData
- a DataObjectListpublic DataObjectListNodeList(UINode baseNode, BoundValue boundData)
baseNode
- a single nodeboundData
- a BoundValue that will be used
to retrieve the DataObjectList at render timepublic DataObjectListNodeList(UINodeList baseNodes, BoundValue boundData)
baseNodes
- a list of UINodes to wrapboundData
- a BoundValue that will be used
to retrieve the DataObjectList at render timeMethod Detail |
public int size(RenderingContext context)
size
in class UINodeListProxy
public UINode getUINode(RenderingContext context, int index)
UINodeList
getUINode
in class UINodeListProxy
public java.lang.Object clone()
UINodeList
clone
in class UINodeListProxy
protected DataObjectList getDataObjectList(RenderingContext context)
protected UINodeList getUINodeList(RenderingContext context)
getUINodeList
in class UINodeListProxy
|
Oracle UIX API Reference Release 2.1.22.0.0 B12196-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |