Package org.zkoss.zk.ui.sys
Class JSCumulativeContentRenderer
java.lang.Object
org.zkoss.zk.ui.sys.JSCumulativeContentRenderer
- All Implemented Interfaces:
ContentRenderer
An implementation of
ContentRenderer that renders
the content as a JavaScript property (i.e., name: ['value', 'value1', ..]) cumulatively.
It can support to add the same name with different value that the different value
will be packed into a list.- Since:
- 8.0
- Author:
- jumperchen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRenders a boolean property.voidRenders a byte property.voidRenders a char property.voidRenders a double property.voidRenders a float property.voidRenders an integer property.voidRenders a long property.voidRenders a short property.voidRenders an arbitrary object property.voidRenders a string property.voidRenders a Date property.voidrenderClientAttributes(Map<String, String> attrs) Renders the client's DOM attributes for the peer widgets.voidrenderDirectly(String name, Object value) Renders the value directly without encapsulation or conversion.voidrenderWidgetAttributes(Map<String, String> attrs) voidrenderWidgetListeners(Map<String, String> listeners) Renders the client code snippet for event listeners registered for the peer widget.voidrenderWidgetOverrides(Map<String, String> overrides) Renders the client code snippet to override the methods and properties of the peer widget.toString()
-
Constructor Details
-
JSCumulativeContentRenderer
public JSCumulativeContentRenderer()
-
-
Method Details
-
render
Description copied from interface:ContentRendererRenders a string property.- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
render
Description copied from interface:ContentRendererRenders a Date property.- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
render
Description copied from interface:ContentRendererRenders an arbitrary object property. What type of supported objects depends on the implementation. However, the following types are always supported: null, String, Date, the wrapper of primitives, an array of the above types, and a map of the above types.If the object is an instance of
JSONAware,JSONAware.toJSONString()will be called, and the return will be generated directly. In other word, it is the same asrenderDirectly(name, value.toJSONString()).If the value is not recognized, it will be converted to a string by use of Object.toString(). It the client's job to convert the string back to the correct object.
- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
render
Description copied from interface:ContentRendererRenders an integer property.- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
render
Description copied from interface:ContentRendererRenders a short property.- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
render
Description copied from interface:ContentRendererRenders a long property.- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
render
Description copied from interface:ContentRendererRenders a byte property.- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
render
Description copied from interface:ContentRendererRenders a boolean property.- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
render
Description copied from interface:ContentRendererRenders a double property.- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
render
Description copied from interface:ContentRendererRenders a float property.- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
render
Description copied from interface:ContentRendererRenders a char property.- Specified by:
renderin interfaceContentRenderer- Throws:
IOException
-
renderDirectly
Description copied from interface:ContentRendererRenders the value directly without encapsulation or conversion. It depends on the implementation. ForJsContentRenderer, value must be a valid JavaScript snippet.- Specified by:
renderDirectlyin interfaceContentRenderer
-
renderWidgetListeners
Description copied from interface:ContentRendererRenders the client code snippet for event listeners registered for the peer widget.- Specified by:
renderWidgetListenersin interfaceContentRenderer- Parameters:
listeners- the map of listeners to register at the peer widget. The key is the event name (such as onClick), and the value the code snippet (such asthis.getFellow('inf').setValue('new')). They are both String instances.
-
renderWidgetOverrides
Description copied from interface:ContentRendererRenders the client code snippet to override the methods and properties of the peer widget.- Specified by:
renderWidgetOverridesin interfaceContentRenderer- Parameters:
overrides- the map of methods or properties to override the peer widget. The key is the method name (such as setValue), and the value must be a valid JavaScript snippet that can be evaluated to a value. They are both instances of String. For example, the map will be generated as follows byJsContentRenderer:
{name1: value1, name2: value2}.
-
renderWidgetAttributes
-
renderClientAttributes
Description copied from interface:ContentRendererRenders the client's DOM attributes for the peer widgets.- Specified by:
renderClientAttributesin interfaceContentRenderer- Parameters:
attrs- the map of attributes. The key is the attribute's name, while the value is the attribute's value. They are both instances of String.
-
toString
-