public interface PageCtrl
Page
for implementation purpose.
Application developers shall never access any of this methods.
Modifier and Type | Method and Description |
---|---|
void |
addAfterHeadTags(java.lang.String tags)
Adds the tags that will be generated inside the head element
and after ZK's default tags.
|
void |
addBeforeHeadTags(java.lang.String tags)
Adds the tags that will be generated inside the head element
and before ZK's default tags.
|
void |
addDeferredZScript(Component parent,
ZScript zscript)
Adds a deferred zscript.
|
void |
destroy()
Called when this page is about to be destroyed.
|
java.lang.String |
getAfterHeadTags()
Returns the tags that shall be generated inside the head element
and after ZK's default tags (never null).
|
java.lang.Boolean |
getAutomaticTimeout()
Returns whether to automatically redirect to the timeout URI.
|
java.lang.String |
getBeforeHeadTags()
Returns the tags that shall be generated inside the head element
and before ZK's default tags (never null).
|
java.lang.Boolean |
getCacheable()
Returns if the client can cache the rendered result, or null
to use the device default.
|
java.lang.String |
getContentType()
Returns the content type, or null to use the device default.
|
java.lang.String |
getDocType()
Returns the doc type (<!
|
java.lang.String |
getFirstLine()
Returns the first line to be generated to the output,
or null if nothing to generate.
|
Component |
getOwner()
Returns the owner of this page, or null if it is not owned by
any component.
|
java.util.Collection<java.lang.Object[]> |
getResponseHeaders()
Returns a readonly collection of response headers (never null).
|
java.lang.String |
getRootAttributes()
Returns the attributes of the root element declared in this page
(never null).
|
java.lang.String |
getWidgetClass()
Returns the widget class of this page, or null to use the device default.
|
void |
init(PageConfig config)
Initializes this page by assigning the info provided by
the specified
PageConfig , and then adds it
to a desktop (by use of Execution.getDesktop() ). |
void |
preInit()
Pre-initializes this page.
|
void |
redraw(java.io.Writer out)
Redraws the whole page into the specified output.
|
void |
sessionDidActivate(Desktop desktop)
Notification that the session, which owns this page,
has just been activated (a.k.a., deserialized).
|
void |
sessionWillPassivate(Desktop desktop)
Notification that the session, which owns this page,
is about to be passivated (a.k.a., serialized).
|
void |
setAutomaticTimeout(java.lang.Boolean autoTimeout)
Sets whether to automatically redirect to the timeout URI.
|
void |
setCacheable(java.lang.Boolean cacheable)
Sets if the client can cache the rendered result.
|
void |
setContentType(java.lang.String contentType)
Sets the content type.
|
void |
setDocType(java.lang.String docType)
Sets the doc type (<!
|
void |
setFirstLine(java.lang.String firstLine)
Sets the first line to be generated to the output.
|
void |
setOwner(Component comp)
Sets the owner of this page.
|
void |
setRootAttributes(java.lang.String rootAttributes)
Set the attributes of the root element declared in this page
Default: "".
|
void |
setWidgetClass(java.lang.String wgtcls)
Sets the widget class of this page.
|
void preInit()
Page.getDesktop()
,
but it doesn't add this page to the desktop yet
(which is done by init(org.zkoss.zk.ui.sys.PageConfig)
).
Note: it is called before
Initiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>)
and init(org.zkoss.zk.ui.sys.PageConfig)
.
Since Page.getDesktop()
is initialized in this
method, it is OK to create components in
Initiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>)
.
void init(PageConfig config)
PageConfig
, and then adds it
to a desktop (by use of Execution.getDesktop()
).
Note: this method is called after preInit()
and
Initiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>)
.
This method shall be called only after the current execution is activated.
config
- the info about how to initialize this pagevoid destroy()
java.lang.String getBeforeHeadTags()
Since it is generated before ZK's default tags (such as CSS and JS), it cannot override ZK's default behaviors.
getAfterHeadTags()
java.lang.String getAfterHeadTags()
Since it is generated after ZK's default tags (such as CSS and JS), it could override ZK's default behaviors.
getBeforeHeadTags()
void addBeforeHeadTags(java.lang.String tags)
((PageCtrl)page).addBeforeHeadTags("");
You could specify the link, meta and script directive to have the similar result.
void addAfterHeadTags(java.lang.String tags)
((PageCtrl)page).addBeforeHeadTags("");
You could specify the link, meta and script directive to have the similar result.
java.util.Collection<java.lang.Object[]> getResponseHeaders()
Date
or String
(and never null).
The third element indicates whether to add (rather than set)
theader. It is an instance of Boolean (and never null).java.lang.String getRootAttributes()
For HTML, the root element is the HTML element.
void setRootAttributes(java.lang.String rootAttributes)
Default: "".
java.lang.String getDocType()
void setDocType(java.lang.String docType)
Default: null (i.e., the device default)
java.lang.String getFirstLine()
For XML devices, it is usually the xml processing instruction:
<?xml version="1.0" encoding="UTF-8"?>
void setFirstLine(java.lang.String firstLine)
Default: null (i.e., nothing generated)
java.lang.String getContentType()
void setContentType(java.lang.String contentType)
java.lang.String getWidgetClass()
void setWidgetClass(java.lang.String wgtcls)
wgtcls
- the widget class. The device default is assumed if wgtcls
is null or empty.java.lang.Boolean getCacheable()
void setCacheable(java.lang.Boolean cacheable)
Default: null (use the device default).
java.lang.Boolean getAutomaticTimeout()
setAutomaticTimeout(java.lang.Boolean)
void setAutomaticTimeout(java.lang.Boolean autoTimeout)
Default: null (use the device default).
If it is set to false, it means this page is redirected to the timeout URI when the use takes some action after timeout. In other words, nothing happens if the user does nothing. If it is set to true, it is redirected as soon as timeout, no matter the user takes any action.
Refer to Configuration.setAutomaticTimeout(java.lang.String, boolean)
for how to configure the device default (default: false).
Component getOwner()
Note: the owner, if not null, must implement Includer
.
void setOwner(Component comp)
Called only internally
Since 5.0.6, the owner must implement Includer
.
void redraw(java.io.Writer out) throws java.io.IOException
You could use Attributes.PAGE_REDRAW_CONTROL
and/or Attributes.PAGE_RENDERER
to control how to render manually.
java.io.IOException
void addDeferredZScript(Component parent, ZScript zscript)
parent
- the component that is the parent of zscript (in
the ZUML page), or null if it belongs to the page.zscript
- the zscript that shall be evaluated as late as
when the interpreter of the same language is being loaded.void sessionWillPassivate(Desktop desktop)
void sessionDidActivate(Desktop desktop)
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.