org.zkoss.zkplus.liferay
Class JQueryRenderPatch

java.lang.Object
  extended by org.zkoss.zkplus.liferay.JQueryRenderPatch
All Implemented Interfaces:
org.zkoss.zk.ui.sys.PageRenderPatch
Direct Known Subclasses:
JQueryRenderCachedPatch, NonRootContextJQueryRenderPatch

public class JQueryRenderPatch
extends Object
implements org.zkoss.zk.ui.sys.PageRenderPatch

Used to patch the rendering result of a ZK portlet for Liferay. When using ZK portlets with Liferay under Internet Explorer, we have to delay the processing at the client a bit.

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).

Since:
5.0.0
Author:
tomyeh, sam

Field Summary
static String JQUERY_PATCH
          A library property to indicate how to apply the so-called jQuery patch.
 
Constructor Summary
JQueryRenderPatch()
           
 
Method Summary
 Writer beforeRender(org.zkoss.zk.ui.sys.RequestInfo reqInfo)
          It returns an instance of StringWriter if getDelay() is non-negative, or null if negative (means no patch).
protected  String getBrowserDelay()
           
 int getDelay()
          Returns the number of milliseconds to wait before replacing with the correct content.
 void patchRender(org.zkoss.zk.ui.sys.RequestInfo reqInfo, org.zkoss.zk.ui.Page page, Writer result, Writer out)
           
protected  String[] processHtml(String html)
           
 void setDelay(int delay)
          Sets the number of milliseconds to wait before replacing with the correct content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JQUERY_PATCH

public static final String JQUERY_PATCH
A library property to indicate how to apply the so-called 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.

See Also:
Constant Field Values
Constructor Detail

JQueryRenderPatch

public JQueryRenderPatch()
Method Detail

getDelay

public int getDelay()
Returns the number of milliseconds to wait before replacing with the correct content.

Default: depends on the value defined in the JQUERY_PATCH library property.


setDelay

public void setDelay(int delay)
Sets the number of milliseconds to wait before replacing with the correct content.

See Also:
JQUERY_PATCH

beforeRender

public Writer beforeRender(org.zkoss.zk.ui.sys.RequestInfo reqInfo)
It returns an instance of StringWriter if getDelay() is non-negative, or null if negative (means no patch).

Specified by:
beforeRender in interface org.zkoss.zk.ui.sys.PageRenderPatch

patchRender

public void patchRender(org.zkoss.zk.ui.sys.RequestInfo reqInfo,
                        org.zkoss.zk.ui.Page page,
                        Writer result,
                        Writer out)
                 throws IOException
Specified by:
patchRender in interface org.zkoss.zk.ui.sys.PageRenderPatch
Throws:
IOException

getBrowserDelay

protected String getBrowserDelay()

processHtml

protected String[] processHtml(String html)


Copyright © 2014. All rights reserved.