public class JQueryRenderPatch extends java.lang.Object implements PageRenderPatch
To use it, you have to specify a library property called ""org.zkoss.zk.portlet.PageRenderPatch.class" with this class's name ("org.zkoss.zkplus.liferay.JQueryRenderPatch").
You can further control the behavior of this patch by use of
a library property called "org.zkoss.zkplus.liferary.jQueryPatch"
(refer to JQUERY_PATCH
for details).
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JQUERY_PATCH
A library property to indicate how to apply the so-called jQuery patch.
|
Constructor and Description |
---|
JQueryRenderPatch() |
Modifier and Type | Method and Description |
---|---|
java.io.Writer |
beforeRender(RequestInfo reqInfo)
It returns an instance of StringWriter if
getDelay() is non-negative,
or null if negative (means no patch). |
protected java.lang.String |
getBrowserDelay() |
int |
getDelay()
Returns the number of milliseconds to wait before replacing with
the correct content.
|
void |
patchRender(RequestInfo reqInfo,
Page page,
java.io.Writer result,
java.io.Writer out)
Called after rendering to patch the result.
|
protected java.lang.String[] |
processHtml(java.lang.String html) |
void |
setDelay(int delay)
Sets the number of milliseconds to wait before replacing with
the correct content.
|
public static final java.lang.String JQUERY_PATCH
Default: "500" (it means 500 milliseconds)
You can specify a number to indicate how many milliseconds to wait before replacing with the correct content. If negative, the patch is ignored.
public int getDelay()
Default: depends on the value defined in the JQUERY_PATCH
library property.
public void setDelay(int delay)
JQUERY_PATCH
public java.io.Writer beforeRender(RequestInfo reqInfo)
getDelay()
is non-negative,
or null if negative (means no patch).beforeRender
in interface PageRenderPatch
reqInfo
- the request informationPageRenderPatch.patchRender(org.zkoss.zk.ui.sys.RequestInfo, org.zkoss.zk.ui.Page, java.io.Writer, java.io.Writer)
(so the writer
is usually an instance of StringWriter).public void patchRender(RequestInfo reqInfo, Page page, java.io.Writer result, java.io.Writer out) throws java.io.IOException
PageRenderPatch
PageRenderPatch.beforeRender(org.zkoss.zk.ui.sys.RequestInfo)
returns null, this method won't be called
since nothing to patch.
If PageRenderPatch.beforeRender(org.zkoss.zk.ui.sys.RequestInfo)
returns a writer, the writer will become
the result argument.
patchRender
in interface PageRenderPatch
reqInfo
- the request informationresult
- the result returned by PageRenderPatch.beforeRender(org.zkoss.zk.ui.sys.RequestInfo)
, and
the rendering result of a page will be written to it.out
- the real output sent to the client. It is the writer
to write the patched result to.java.io.IOException
protected java.lang.String getBrowserDelay()
protected java.lang.String[] processHtml(java.lang.String html)
Copyright © 2005-2021 Potix Corporation. All Rights Reserved.