|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FacesParentReliantComponent
This interface tags a UIComponent
that depends on it's direct parent
in some way, and will not behave the same if a panel is inserted between it
and its normal parent. An example is the UISelectItemEx
control,
which does not render itself but depends on the parent control to render some
output representing that item.
The reason to add this interface to controls that rely on their parents is to
handle the case where the control has been moved out of the main XPage, into
a Custom Control. When a custom control is used to import an XPages snippet
into the main XPage, it leaves a panel-like UIIncludeComposite
control in the control tree, containing the contents of the included custom
control.
When a control implements this interface, and it is the only control in the
custom control snippet, the custom control component will remove itself from
the control tree, so that the parent reliant control will have the correct
direct parent. If the UIIncludeComposite.isAutoRemove()
property is
set to false
, it will not remove itself.
There are disadvantages to this behavior. The custom control component
normally provides the "compositeData" object, containing property values as
defined in the Custom Control Properties editor, Property Definition tab.
Once it is removed, that object will only be available during "On Page Load"
bindings, not when you "Compute Dynamically". Also, the custom control
component normally provides a NamingContainer
, so that when multiple
instances of the custom control are used on an XPage, the IDs in the HTML
source are not duplicated.
(Implementations could save the compositeData object when
changedParent(FacesContext, UIComponent, UIComponent)
is called, and
publish it to be available to dynamic bindings.)
Method Summary | |
---|---|
void |
changedParent(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent oldParent,
javax.faces.component.UIComponent newParent)
|
Method Detail |
---|
void changedParent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent oldParent, javax.faces.component.UIComponent newParent)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |