Client Attribute

From Documentation
Revision as of 02:12, 26 March 2014 by Noahhuang (talk | contribs)


Client Attribute


Name: client attribute
Namespace: http://www.zkoss.org/2005/zk/client/attribute
Namespace shortcut: client/attribute
Java: LanguageDefinition.CLIENT_ATTRIBUTE_NAMESPACE

It is the reserved namespace for specifying client-side DOM attributes. Unlike the client namespace, which assigns something to widgets, the client/attribute namespace assigns additional DOM attributes to the DOM tree directly at the client.


Notice that if the widget's DOM output (Widget.redraw(Array)) also has the same DOM attribute, both of them will be generated and it is technically not legal. Thus, you shall prevent the DOM attributes that widget might output.

For example, suppose you want to listen to the onload event, and then you can do as follows[1].

<iframe src="http://www.google.com" width="100%" height="300px"
  xmlns:ca="client/attribute"
  ca:onload="do_whater_you_want()"/>


Each layout region in borderlayout can support to close and open the region area by user's swipe on the edge of the region with client/attribute[2].

 ZK EE only
<borderlayout xmlns:ca="client/attribute" ca:data-swipeable="true">
<!-- omitted -->
</borderlayout>


Tabbox support to switch the tab by user swipe on the edge of content with client attribute[3].

 ZK EE only
<tabbox xmlns:ca="client/attribute" ca:data-swipeable="true">
    <!-- omitted -->
</tabbox>


Within Tree, Grid, and Listbox, Paging can support to navigate previous page or next page by user swipe on the edge of content with client attribute[4].

 ZK EE only
<listbox mold="paging" pageSize="5" xmlns:ca="client/attribute" ca:data-swipeable="true"></listbox>


Calendar can support to switch the view by user swipe on the content with client/attribute[5].

 ZK EE only
<calendar xmlns:ca="client/attribute" ca:data-swipeable="true" />

If the attribute contains colon or other special characters, you can use the attribute element as follows.

<div xmlns:ca="client/attribute">
  <attribute ca:name="ns:whatever">
  whatever_value_you_want
  </attribute>
</div>

The other use of the client-attribute namespace is to specify attributes that are available only to certain browsers, such as accessibility and Section 508.


  1. For more information, please refer to ZK Component Reference: iframe.
  2. For more information, please refer to ZK Component Reference Tablet Devices: Borderlayout.
  3. For more information, please refer to ZK Component Reference Tablet Devices: Tabbox.
  4. For more information, please refer to ZK Component Reference Tablet Devices: Paging.
  5. For more information, please refer to ZK Component Reference Tablet Devices: Calendar.

Version History

Last Update : 2014/03/26


Version Date Content
5.0.3 July 2010 The client-attribute namespace was introduced.



Last Update : 2014/03/26

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.