|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlShadowElement
org.zkoss.zuti.zul.TemplateBasedShadowElement
org.zkoss.zuti.zul.Apply
public class Apply
The apply tag allows you to choose which template to be applied. You specify the template's name using the template attribute or the template's URI using the templateURI attribute.
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlShadowElement |
|---|
HtmlShadowElement.Direction |
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
AbstractComponent.Children |
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
_props
|
| Fields inherited from class org.zkoss.zuti.zul.TemplateBasedShadowElement |
|---|
_dirtyBinding, FOREACH_RENDERED_COMPONENTS, ON_BINDING_READY, SHADOW_VARIABLE |
| Fields inherited from class org.zkoss.zk.ui.HtmlShadowElement |
|---|
_afterComposed, BIND_ANNO, BINDER, INIT_ANNO, LOAD_ANNO, ON_REBUILD_SHADOW_TREE_LATER, REFERENCE_ANNO, SAVE_ANNO |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl |
|---|
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE |
| Constructor Summary | |
|---|---|
Apply()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clones the component. |
protected void |
compose(Component host)
Composes from template name and then template uri, if any. |
java.util.Map<java.lang.String,java.lang.Object> |
getDynamicProperties()
|
java.lang.Object |
getDynamicProperty(java.lang.String name)
Returns the property value of the specified name. |
java.lang.String |
getTemplate()
Returns the template name Default: empty string |
java.lang.String |
getTemplateURI()
|
boolean |
hasDynamicProperty(java.lang.String name)
Returns whether a dynamic property is defined. |
protected boolean |
isEffective()
Returns whether the shadow element is effective |
protected Template |
resolveTemplate()
Return the template, if any, the default implementation will look up the template where in its parent shadow or its shadow host. |
java.lang.Object |
resolveVariable(Component child,
java.lang.String name,
boolean recurse)
Returns the variable associated with this base component or null if not found. |
void |
setDynamicProperty(java.lang.String name,
java.lang.Object value)
Sets a property with the specified name and value. |
void |
setTemplate(java.lang.String template)
Sets the template name to apply |
void |
setTemplateURI(java.lang.String templateURI)
Sets the template uri. |
| Methods inherited from class org.zkoss.zuti.zul.TemplateBasedShadowElement |
|---|
addBindingListener, afterCompose, detach, docheck0, isBindingReady, isDynamicValue, onChildAdded, onChildRemoved, rebuildSubShadowTree, removeBindingListener |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient java.util.Map<java.lang.String,java.lang.Object> _props
| Constructor Detail |
|---|
public Apply()
| Method Detail |
|---|
public java.lang.String getTemplate()
Default: empty string
public void setTemplate(java.lang.String template)
public void setTemplateURI(java.lang.String templateURI)
If templateURI is changed, the whole shadow is recreated.
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 java.lang.String getTemplateURI()
protected Template resolveTemplate()
public java.lang.Object resolveVariable(Component child,
java.lang.String name,
boolean recurse)
ShadowElementCtrlNotice that it doesn't check any variable defined in
VariableResolver
(of Page.addVariableResolver(org.zkoss.xel.VariableResolver)).
resolveVariable in interface ShadowElementCtrlresolveVariable in class HtmlShadowElementchild - the child component of the shadow hostrecurse - whether to look up the parent shadow for the
existence of the variable.protected void compose(Component host)
compose in class TemplateBasedShadowElementhost - the shadow host component, never null.protected boolean isEffective()
HtmlShadowElement
isEffective in class TemplateBasedShadowElementpublic boolean hasDynamicProperty(java.lang.String name)
DynamicPropertied
hasDynamicProperty in interface DynamicPropertiedpublic java.lang.Object getDynamicProperty(java.lang.String name)
DynamicPropertied
getDynamicProperty in interface DynamicPropertiedpublic java.util.Map<java.lang.String,java.lang.Object> getDynamicProperties()
public void setDynamicProperty(java.lang.String name,
java.lang.Object value)
throws WrongValueException
DynamicPropertiedIf a component supports only String-type values, it could use org.zkoss.lang.Objects.toString() to convert the value to a String instance.
setDynamicProperty in interface DynamicPropertiedWrongValueExceptionpublic java.lang.Object clone()
Component
clone in interface Componentclone in class TemplateBasedShadowElement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||