public class Apply extends TemplateBasedShadowElement implements org.zkoss.zk.ui.ext.DynamicPropertied
There are two ways to pass parameters to the apply shadow:
First, you can use setDynamicProperty(java.lang.String, java.lang.Object), or, in ZUL,
<apply templateURI="/WEB-INF/mypage" arg="something"/>
Second, you can use the query string:
<apply templateURI="/WEB-INF/mypage?arg=something"/>
With the query string, you can pass only the String values.
and the parameter can be accessed by Execution.getArg()
Or, you can access it with the arg variable in EL expressions.
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
_props |
_dirtyBinding, FOREACH_RENDERED_COMPONENTS, ON_BINDING_READY, SHADOW_VARIABLE_afterComposed, _dynamicValue, BIND_ANNO, BINDER, INIT_ANNO, LOAD_ANNO, ON_REBUILD_SHADOW_TREE_LATER, REFERENCE_ANNO, SAVE_ANNO| Constructor and Description |
|---|
Apply() |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
protected void |
compose(org.zkoss.zk.ui.Component host)
Composes from template name and then template uri, if any.
|
Map<String,Object> |
getDynamicProperties() |
Object |
getDynamicProperty(String name) |
org.zkoss.zk.ui.sys.PropertyAccess |
getPropertyAccess(String prop) |
String |
getTemplate()
Returns the template name
|
String |
getTemplateURI() |
boolean |
hasDynamicProperty(String name) |
protected boolean |
isEffective() |
protected org.zkoss.zk.ui.util.Template |
resolveTemplate()
Return the template, if any, the default implementation will look up
the template where in its parent shadow or its
shadow host.
|
Object |
resolveVariable(org.zkoss.zk.ui.Component child,
String name,
boolean recurse) |
void |
setDynamicProperty(String name,
Object value) |
void |
setTemplate(String template)
Sets the template name to apply.
|
void |
setTemplateURI(String templateURI)
Sets the template uri.
|
addBindingListener, afterCompose, detach, docheck0, isBindingReady, isDynamicValue, onChildAdded, onChildRemoved, rebuildSubShadowTree, removeBindingListenerafterHostChildAdded, afterHostChildRemoved, asShadow, beforeChildAdded, beforeHostChildAdded, beforeHostChildRemoved, beforeHostParentChanged, beforeParentChanged, clearChildren, getDistributedChildren, getFirstInsertion, getLastInsertion, getNextInsertion, getNextInsertionComponentIfAny, getPreviousInsertion, getPreviousInsertionComponentIfAny, getShadowHost, getShadowHostIfAny, inRange, invalidate, isDynamicValue, mergeSubTree, mergeToHost, onHostAttached, onHostChildAdded, onHostChildRemoved, onHostDetached, recreate, removeFromParent, setDynamicValue, setParent, setPrevInsertion, setShadowHost, shrinkRange, stretchRange, toString, updateSubBindingAnnotationCountaddAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getExtraCtrl, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidatePartial, isChildable, isInvalidated, isListenerAvailable, isVisible, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderProperties, replace, response, response, response, service, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, updateByClient, willPassivate, willPassivate, willSerialize, willSerializepublic String getTemplate()
Default: empty string
public void setTemplate(String template)
One cannot set both template and template URI in the same time.
Notice that, the template enclosed with <apply> tag will be created only when both template and template URI are not set.
public void setTemplateURI(String templateURI)
If templateURI is changed, the whole shadow is recreated. One cannot set both template and template URI in the same time.
Notice that, the template enclosed with <apply> tag will be created only when both template and template URI are not set.
templateURI - the template URI. If null or empty, nothing is applied.
You can specify the template URI with the query string and they
will become a map of parameters that is accessible by the arg variable
in EL, or by Execution.getArg().
For example, if "/a.zul?b=c" is specified, you can access
the parameter with ${arg.b} in a.zul.setDynamicProperty(java.lang.String, java.lang.Object)public String getTemplateURI()
protected org.zkoss.zk.ui.util.Template resolveTemplate()
public Object resolveVariable(org.zkoss.zk.ui.Component child, String name, boolean recurse)
resolveVariable in interface org.zkoss.zk.ui.ShadowElementCtrlresolveVariable in class org.zkoss.zk.ui.HtmlShadowElementprotected void compose(org.zkoss.zk.ui.Component host)
compose in class TemplateBasedShadowElementprotected boolean isEffective()
isEffective in class TemplateBasedShadowElementpublic boolean hasDynamicProperty(String name)
hasDynamicProperty in interface org.zkoss.zk.ui.ext.DynamicPropertiedpublic Object getDynamicProperty(String name)
getDynamicProperty in interface org.zkoss.zk.ui.ext.DynamicPropertiedpublic void setDynamicProperty(String name, Object value) throws org.zkoss.zk.ui.WrongValueException
setDynamicProperty in interface org.zkoss.zk.ui.ext.DynamicPropertiedorg.zkoss.zk.ui.WrongValueExceptionpublic org.zkoss.zk.ui.sys.PropertyAccess getPropertyAccess(String prop)
getPropertyAccess in interface org.zkoss.zk.ui.sys.ComponentCtrlgetPropertyAccess in class org.zkoss.zk.ui.AbstractComponentpublic Object clone()
clone in interface org.zkoss.zk.ui.Componentclone in class TemplateBasedShadowElementCopyright © 2020. All rights reserved.