|
Oracle Fusion Middleware Java API Reference for Oracle ADF Faces 11g Release 1 (11.1.1) E10684-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.adf.view.rich.activedata.ActiveComponentContext
public final class ActiveComponentContext
Called by Renderers that want to support active data on their attributes. The current instance is retrieved by calling the factory method ActiveComponentContext.getActiveComponentContext()
.
A Renderer that wishes to support active data on its attributes should:
pushActiveComponent
with its component before retrieving any attributes.startActiveAttribute
and then call endActiveAttribute
after the value has been retrieved.popActiveComponent
after all of the active attributes have been retrieved.If any of the potentially active attributes were bound to ActiveDataModels, popActiveComponent
will register an ActiveDataEncoder for the component.
Method Summary | |
---|---|
void |
endActiveAttribute(java.lang.String attributeName) Removes the association of active data with the attributeName component attribute. |
static ActiveComponentContext |
getActiveComponentContext() Returns an instance of the ActiveComponentContext for use by a component that wants to support active data on its attributes. |
boolean |
hasActiveData() Returns true if the currently pushed active component currently has associated active data. |
void |
popActiveComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) Stops associating active data with this component, registering an appropriate ActiveDataEncoder with any ActiveDataModels providing active data for the active attributes. |
void |
pushActiveComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) Begins associating active data with the specifiec component, creating a new association context in the process |
void |
startActiveAttribute(java.lang.String attributeName) Sets the name of the component attribute that any EL references to ActiveDataModels should be associated with until the corresponding cleatActiveAttribute is called. |
void |
startSupressingActiveComponents() Called by Renderers that perform their own active component management to disable the generation of the mapping between components and ActiveDataModels on the current component and its children. |
void |
stopSupressingActiveComponents() Called by Renderers that perform their own active component management to disable the generation of the mapping between components and ActiveDataModels. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ActiveComponentContext getActiveComponentContext()
public void startSupressingActiveComponents()
startSupressingActiveComponents
may be nested.java.lang.IllegalStateException
- if there are no current active components on the stackstopSupressingActiveComponents()
public void stopSupressingActiveComponents()
java.lang.IllegalStateException
- if active data mapping collection isn't currently suppressedstartSupressingActiveComponents()
public void pushActiveComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
In order to avoid mismatched pushActiveComponent
/popActiveComponent
pairs if an exception occurs when fetching the attribute value, try
/ finally
should be used:
protected void encodeAll( FacesContext context, RenderingContext rc, UIComponent component, ClientComponent client, FacesBean bean ) throws IOException { ActiveComponentContext activeContext = ActiveComponentContext.getActiveComponentContext(); activeContext.pushActiveComponent(component); try { super.encodeAll(context, rc, component, client, bean); } finally { activeContext.popActiveComponent(context, component); } }
component
- UIComponent to begin associating active data withjava.lang.NullPointerException
- if context or component are null
.popActiveComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
public void startActiveAttribute(java.lang.String attributeName)
Sets the name of the component attribute that any EL references to ActiveDataModels should be associated with until the corresponding cleatActiveAttribute
is called.
In order to avoid mismatched setActiveAttribute
/clearActiveAttribute
pairs if an exception occurs when fetching the attribute value, try
/ finally
should be used:
ActiveComponentContext activeContext = ActiveComponentContext.getActiveComponentContext(); // support active data for the source attribute activeContext.startActiveAttribute("source"); String srcURI; try { srcURI = super.getSource(bean); } finally { // done with the source attribtue activeContext.endActiveAttribute("source"); }
Any attribute that supports active data should have an optimized client-side setter
attributeName
- Name of component attribute to associate active data with.java.lang.IllegalStateException
- if pushActiveComponent
hasn't been called or there is already an attribute active on this component.java.lang.IllegalArgumentException
- if attributeName is null
attribute is currently started.endActiveAttribute(java.lang.String)
, pushActiveComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
public void endActiveAttribute(java.lang.String attributeName)
attributeName
- Name of component attribute to stop associating active data withjava.lang.IllegalStateException
- if the cleared attribute doesn't match the currently set attribute.java.lang.NullPointerException
- if attributeName is null
.startActiveAttribute(java.lang.String)
public boolean hasActiveData()
true
if the currently pushed active component currently has associated active data.public void popActiveComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
context
- Current FacesContextcomponent
- UIComponent to stop associating active data withjava.lang.IllegalStateException
- if the cleared attribute doesn't match the currently set attribute.java.lang.NullPointerException
- if attributeName or attributeEncoder are null
.pushActiveComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Faces 11g Release 1 (11.1.1) E10684-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |