|
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.data.tree.BaseTreeDataProxy
|
+--oracle.cabo.ui.data.tree.ClientStateHGridDataProxy
This HGrid proxy supports expanding/collapsing (all) tree nodes and focusing on subtree nodes. It does this by storing the current HGrid state on the client side. This proxy is designed for use with an immutable tree; the proxy does not detect if the backend data tree has been modified since its state was recorded on the client side.
In order to use this class, an instance of this class must be bound to the
proxy attribute of an
HGrid. Once bound, the appropriate links of the HGrid will behave like a
form submission with a parameter named UIConstants.EVENT_PARAM set
to one of UIConstants.EXPAND_EVENT, UIConstants.FOCUS_EVENT, UIConstants.EXPAND_ALL_EVENT, and UIConstants.COLLAPSE_ALL_EVENT. In addition there could be another four
parameters: UIConstants.SOURCE_PARAM, UIConstants.STATE_PARAM, UIConstants.ROOT_PARAM and UIConstants.NODE_PARAM.
The UIConstants.SOURCE_PARAM identifies the HGrid (or Tree) element
that generated the event (this is obtained from the ID attribute of the
bean). The UIConstants.STATE_PARAM is an encoding of the current
state of the HGrid. UIConstants.ROOT_PARAM is an index. This index
identifies the current focus root of the HGrid. UIConstants.NODE_PARAM identifies some tree node that needs to be expanded
or collapsed.
When handling these requests on the server, it is necessary to call the correct ClientStateHGridDataProxy constructor that matches the event. This new proxy must be used to render the HGrid so that the interaction is continued. The following is an example:
First the HGridBean is created and the proxy is bound:-
HGridBean hgrid = new HGrid();
hgrid.setID("hgrid");
hgrid.setAttributeValue(UIConstants.PROXY_ATTR,
new ContextPropertyBoundValue("my namespace",
"HGrid State"));
Prior to rendering, the server must examine the request to obtain the necessary parameters to use to construct the HGridDataProxy:-
String event = request.getParameter(UIConstants.EVENT_PARAM);
String source = request.getParameter(UIConstants.SOURCE_PARAM);
String state = request.getParameter(UIConstants.STATE_PARAM);
String root = request.getParameter(UIConstants.ROOT_PARAM);
String node = request.getParameter(UIConstants.NODE_PARAM);
HGridDataProxy proxy;
if (UIConstants.EXPAND_EVENT.equals(event))
proxy = new ClientStateHGridDataProxy(state, root, node);
else if (UIConstants.FOCUS_EVENT.equals(event))
proxy = new ClientStateHGridDataProxy(state, root);
else if (UIConstants.EXPAND_ALL_EVENT.equals(event))
proxy = new ClientStateHGridDataProxy(state, root, true);
else if (UIConstants.COLLAPSE_ALL_EVENT.equals(event))
proxy = new ClientStateHGridDataProxy(state, root, false);
else
proxy = new ClientStateHGridDataProxy();
renderingContext.setProperty("my namespace", "HGrid State", proxy);
EXPAND_ALL_KEY property on the
DataObject that represents the respective subtree node. If
this property is bound to Boolean.FALSE then expand-all (and
collapse-all) will not be generated for that subtree. In Addition, an
expand/collapse-all performed on a parent node, will not affect a child node
with expand-all disabled.
setBreadCrumbsEnabled(boolean) with false. Note that it is not possible
to disable the breadcrumbs if the HGrid is already focused in on a subtree,
the reason being that the only way a user can focus out is to use the
breadcrumbs.
HGridBean,
TreeBean,
ClientStateTreeDataProxy| Field Summary | |
static java.lang.String |
EXPAND_ALL_KEY
the key to examine when deciding the feasibility of performing an expand-all. |
| Constructor Summary | |
ClientStateHGridDataProxy()
Constructs a proxy with no tree state. |
|
ClientStateHGridDataProxy(int[] focusRootPath)
Constructs a proxy that produces an HGrid that is initially focused on a given tree node. |
|
ClientStateHGridDataProxy(java.lang.String state,
java.lang.String root)
Create a proxy in response to a focus
event |
|
ClientStateHGridDataProxy(java.lang.String state,
java.lang.String root,
boolean expandAll)
Create a proxy in response to an expandAll (or collapseAll) event |
|
ClientStateHGridDataProxy(java.lang.String state,
java.lang.String root,
java.lang.String node)
Create a proxy in response to an expand
event |
|
| Method Summary | |
void |
doPostRender(RenderingContext context,
UINode node)
renders the javascript needed by this proxy |
DataObjectList |
getBreadCrumbs(RenderingContext context,
DataObject root)
|
java.lang.String |
getCollapseAllDestination(RenderingContext context,
DataObject focusRoot)
Gets the destination of the collapse-all link in an HGrid. |
java.lang.String |
getCollapseDestination(RenderingContext context,
DataObject node,
int index)
Returns a destination that would collapse the tree at the indicated node. |
java.lang.String |
getExpandable(RenderingContext context,
DataObject node,
int index)
Is this node expanded? |
java.lang.String |
getExpandAllDestination(RenderingContext context,
DataObject focusRoot)
Gets the destination of the expand-all link in an HGrid. |
java.lang.String |
getExpandDestination(RenderingContext context,
DataObject node,
int index)
Returns a destination that would expand the tree at the indicated node. |
java.lang.String |
getFocusDestination(RenderingContext context,
DataObject node,
int index)
Returns a destination that would focus the HGrid at the indicated node. |
DataObject |
getFocusRoot(RenderingContext context,
DataObject root)
Gets the tree node that has the focus. |
DataObject |
getTreeNode(RenderingContext context,
DataObject root,
int index)
|
boolean |
isExpandAllEnabled(RenderingContext context,
DataObject focusRoot)
checks to see if the expand/collapse-all links on this HGrid are enabled. |
void |
setBreadCrumbsEnabled(boolean isEnabled)
Use this method to hide the breadcrumbs. |
| Methods inherited from class oracle.cabo.ui.data.tree.BaseTreeDataProxy |
getChildren, isSelected, selectionEnabled, setFormName, sharedInstance |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface oracle.cabo.ui.data.tree.TreeDataProxy |
getChildren, isSelected, selectionEnabled, setFormName |
| Field Detail |
public static final java.lang.String EXPAND_ALL_KEY
isExpandAllEnabled(RenderingContext, DataObject)| Constructor Detail |
public ClientStateHGridDataProxy()
public ClientStateHGridDataProxy(int[] focusRootPath)
focusRootPath - This describes the path from the root of the tree
to the subnode that must be the current focus root. Each element in this
array indicates the child index of the next node on the path. ie: The
I+1'th node is the focusRootPath[I]'th child of node I.
Node zero is the root of the tree. int[] focusRootPath = {4, 1};
This follows the child at index 4 (which is the 5th child), and then
follows that node's child at index 1 (which is its 2nd child).
public ClientStateHGridDataProxy(java.lang.String state,
java.lang.String root)
focus
eventstate - the encoded string with the current state of the tree.root - this identifies the current focus root of the HGridjava.lang.IllegalArgumentException - if the above strings are not well
formed.
public ClientStateHGridDataProxy(java.lang.String state,
java.lang.String root,
boolean expandAll)
expandAll (or collapseAll) eventstate - the encoded string with the current state of the tree.root - this identifies the current focus root of the HGrid. The
expand/collapse all takes place starting at this node.expandAll - if true does an expand-all. Otherwise do a collapse-all.java.lang.IllegalArgumentException - if the above strings are not well
formed.
public ClientStateHGridDataProxy(java.lang.String state,
java.lang.String root,
java.lang.String node)
expand
eventstate - the encoded string with the current state of the tree.root - this identifies the current focus root of the HGridnode - this identifies the node that must be expanded/collapsedjava.lang.IllegalArgumentException - if the above strings are not well
formed.| Method Detail |
public void setBreadCrumbsEnabled(boolean isEnabled)
isEnabled - The breadcrumbs are enabled by default. Setting this to
false will hide the breadcrumbs.java.lang.IllegalArgumentException - if the breadcrumbs cannot be
disabled.
public void doPostRender(RenderingContext context,
UINode node)
throws java.io.IOException
doPostRender in interface TreeDataProxydoPostRender in class BaseTreeDataProxynode - the HGrid UINode
public java.lang.String getFocusDestination(RenderingContext context,
DataObject node,
int index)
getFocusDestination in interface HGridDataProxynode - the tree nodeindex - the row index of this tree node
public java.lang.String getExpandDestination(RenderingContext context,
DataObject node,
int index)
getExpandDestination in interface TreeDataProxygetExpandDestination in class BaseTreeDataProxynode - the tree nodeindex - the row index of this tree node
public java.lang.String getCollapseDestination(RenderingContext context,
DataObject node,
int index)
getCollapseDestination in interface TreeDataProxygetCollapseDestination in class BaseTreeDataProxynode - the tree nodeindex - the row index of this tree node
public java.lang.String getExpandable(RenderingContext context,
DataObject node,
int index)
TreeDataProxygetExpandable in interface TreeDataProxygetExpandable in class BaseTreeDataProxyUIConstants.EXPANDABLE_NO,
UIConstants.EXPANDABLE_EXPANDED or
UIConstants.EXPANDABLE_COLLAPSED
public DataObject getFocusRoot(RenderingContext context,
DataObject root)
HGridDataProxygetFocusRoot in interface HGridDataProxyroot - the root of the HGrid tree.
public DataObject getTreeNode(RenderingContext context,
DataObject root,
int index)
root - the root of the HGrid tree.index - the row index (zero based) of the required tree node.
public DataObjectList getBreadCrumbs(RenderingContext context,
DataObject root)
getBreadCrumbs in interface HGridDataProxyroot - the root of the tree
public boolean isExpandAllEnabled(RenderingContext context,
DataObject focusRoot)
HGridDataProxyisExpandAllEnabled in interface HGridDataProxyfocusRoot - checks to see if it is feasible to completely expand
this focus root.focusRoot has a property
EXPAND_ALL_KEY and its value is not
Boolean.FALSEEXPAND_ALL_KEY,
Boolean.FALSE
public java.lang.String getExpandAllDestination(RenderingContext context,
DataObject focusRoot)
HGridDataProxygetExpandAllDestination in interface HGridDataProxyfocusRoot - The current focus of the HGrid
public java.lang.String getCollapseAllDestination(RenderingContext context,
DataObject focusRoot)
HGridDataProxygetCollapseAllDestination in interface HGridDataProxyfocusRoot - The current focus of the HGrid
|
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 | ||||||||