Client Attribute"

From Documentation
Line 38: Line 38:
  
 
<source lang="xml">
 
<source lang="xml">
<borderlayout xmlns:ca="client/attribute" ca:data-swipeable="true">
+
<div xmlns:ca="client/attribute">
<!-- omitted -->
+
  <borderlayout xmlns:ca="client/attribute" ca:data-swipeable="true">
</borderlayout>
+
  whatever_value_you_want
 +
  </borderlayout>
 +
</div>
 
</source>
 
</source>
  
Line 46: Line 48:
 
Tabbox support to switch the tab by user swipe on the edge of content with client attribute<ref>For more information, please refer to [[ZK Component Reference/Tablet Devices/UI Enhancements/Tabbox#SwipeEvent_Support|ZK Component Reference Tablet Devices: Tabbox]].</ref>.
 
Tabbox support to switch the tab by user swipe on the edge of content with client attribute<ref>For more information, please refer to [[ZK Component Reference/Tablet Devices/UI Enhancements/Tabbox#SwipeEvent_Support|ZK Component Reference Tablet Devices: Tabbox]].</ref>.
 
<source lang="xml">
 
<source lang="xml">
<tabbox xmlns:ca="client/attribute" ca:data-swipeable="true">
+
<div xmlns:ca="client/attribute">
    <!-- omitted -->
+
  <tabbox xmlns:ca="client/attribute" ca:data-swipeable="true">
</tabbox>
+
  whatever_value_you_want
 +
  </tabbox>
 +
</div>
 
</source>
 
</source>
  
Line 54: Line 58:
 
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<ref>For more information, please refer to [[ZK Component Reference/Tablet Devices/UI Enhancements/Paging#SwipeEvent_Support|ZK Component Reference Tablet Devices: Paging]].</ref>.
 
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<ref>For more information, please refer to [[ZK Component Reference/Tablet Devices/UI Enhancements/Paging#SwipeEvent_Support|ZK Component Reference Tablet Devices: Paging]].</ref>.
 
<source lang="xml">
 
<source lang="xml">
 +
<div xmlns:ca="client/attribute">
 
<listbox mold="paging" pageSize="5" xmlns:ca="client/attribute" ca:data-swipeable="true"></listbox>
 
<listbox mold="paging" pageSize="5" xmlns:ca="client/attribute" ca:data-swipeable="true"></listbox>
 +
</div>
 
</source>
 
</source>
  
Line 60: Line 66:
 
Calendar can support to switch the view by user swipe on the content with client/attribute<ref>For more information, please refer to [[ZK Component Reference/Tablet Devices/UI Enhancements/Calendar#Friendly_Scrolling_Support|ZK Component Reference Tablet Devices: Calendar]].</ref>.
 
Calendar can support to switch the view by user swipe on the content with client/attribute<ref>For more information, please refer to [[ZK Component Reference/Tablet Devices/UI Enhancements/Calendar#Friendly_Scrolling_Support|ZK Component Reference Tablet Devices: Calendar]].</ref>.
 
<source lang="xml">
 
<source lang="xml">
 +
<div xmlns:ca="client/attribute">
 
<calendar xmlns:ca="client/attribute" ca:data-swipeable="true" />
 
<calendar xmlns:ca="client/attribute" ca:data-swipeable="true" />
 +
</div>
 
</source>
 
</source>
  
Line 68: Line 76:
 
For more information, please refer to http://www.zkoss.org/javadoc/7.0.1/jsdoc/zul/ContainerWidget.html</ref>.
 
For more information, please refer to http://www.zkoss.org/javadoc/7.0.1/jsdoc/zul/ContainerWidget.html</ref>.
 
<source lang="xml">
 
<source lang="xml">
 +
<div xmlns:ca="client/attribute">
 
<window height="100px" contentStyle="overflow:auto" ca:data-scrollable="true">
 
<window height="100px" contentStyle="overflow:auto" ca:data-scrollable="true">
 
</window>
 
</window>
 +
</div>
 
</source>
 
</source>
  
 
When user swipe on the content of Listbox, Grid, Tree in tablet device, the friendly scrollbar will appear. To disable the friendly scrollbar, please use the following setting<ref>For more information, please refer to [[ZK Component Reference/Tablet Devices/UI Enhancements/Listbox#Friendly_Scrolling_Support|ZK Component Reference Tablet Devices: Listbox]], [[ZK Component Reference/Tablet Devices/UI Enhancements/Grid#Friendly_Scrolling_Support|ZK Component Reference Tablet Devices: Grid]], [[ZK Component Reference/Tablet Devices/UI Enhancements/Tree#Friendly_Scrolling_Support|ZK Component Reference Tablet Devices: Tree]].</ref>.
 
When user swipe on the content of Listbox, Grid, Tree in tablet device, the friendly scrollbar will appear. To disable the friendly scrollbar, please use the following setting<ref>For more information, please refer to [[ZK Component Reference/Tablet Devices/UI Enhancements/Listbox#Friendly_Scrolling_Support|ZK Component Reference Tablet Devices: Listbox]], [[ZK Component Reference/Tablet Devices/UI Enhancements/Grid#Friendly_Scrolling_Support|ZK Component Reference Tablet Devices: Grid]], [[ZK Component Reference/Tablet Devices/UI Enhancements/Tree#Friendly_Scrolling_Support|ZK Component Reference Tablet Devices: Tree]].</ref>.
 
<source lang="xml">
 
<source lang="xml">
 +
<div xmlns:ca="client/attribute">
 
<listbox xmlns:a="client/attribute" a:data-scrollable="false"/>
 
<listbox xmlns:a="client/attribute" a:data-scrollable="false"/>
 +
</div>
 
</source>
 
</source>
  
Line 82: Line 94:
  
 
<source lang="xml">
 
<source lang="xml">
 +
<div xmlns:ca="client/attribute">
 
<grid ca:data-embedscrollbar="true"></grid>
 
<grid ca:data-embedscrollbar="true"></grid>
 +
</div>
 
</source>
 
</source>
  
Line 89: Line 103:
 
To prevent conflict with 'next' and 'previous' button on virtual keyboard on iPad. The input element should apply data-fixScrollPosition attribute<ref>For more information, please refer to http://tracker.zkoss.org/browse/ZK-1285</ref>.
 
To prevent conflict with 'next' and 'previous' button on virtual keyboard on iPad. The input element should apply data-fixScrollPosition attribute<ref>For more information, please refer to http://tracker.zkoss.org/browse/ZK-1285</ref>.
 
<source lang="xml">
 
<source lang="xml">
 +
<div xmlns:ca="client/attribute">
 
<textbox xmlns:ca="client/attribute" ca:data-fixScrollPosition="true"></textbox>
 
<textbox xmlns:ca="client/attribute" ca:data-fixScrollPosition="true"></textbox>
 +
</div>
 
</source>
 
</source>
  

Revision as of 03:31, 7 April 2014


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()"/>


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>

data-swipeable

 ZK EE tablet only

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

<div xmlns:ca="client/attribute">
  <borderlayout xmlns:ca="client/attribute" ca:data-swipeable="true">
  whatever_value_you_want
  </borderlayout>
</div>


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

<div xmlns:ca="client/attribute">
  <tabbox xmlns:ca="client/attribute" ca:data-swipeable="true">
  whatever_value_you_want
  </tabbox>
</div>


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

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


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

<div xmlns:ca="client/attribute">
<calendar xmlns:ca="client/attribute" ca:data-swipeable="true" />
</div>

data-scrollable

if user scroll container widget which applys the data-scrollable attribute, the errorbox should scroll with container widget[6].

<div xmlns:ca="client/attribute">
<window height="100px" contentStyle="overflow:auto" ca:data-scrollable="true">
</window>
</div>

When user swipe on the content of Listbox, Grid, Tree in tablet device, the friendly scrollbar will appear. To disable the friendly scrollbar, please use the following setting[7].

<div xmlns:ca="client/attribute">
<listbox xmlns:a="client/attribute" a:data-scrollable="false"/>
</div>

data-embedscrollbar

To show the position of zk customize scrollbar, the mesh component should apply data-embedscrollbar attribute.

<div xmlns:ca="client/attribute">
<grid ca:data-embedscrollbar="true"></grid>
</div>

data-fixscrollposition

To prevent conflict with 'next' and 'previous' button on virtual keyboard on iPad. The input element should apply data-fixScrollPosition attribute[8].

<div xmlns:ca="client/attribute">
<textbox xmlns:ca="client/attribute" ca:data-fixScrollPosition="true"></textbox>
</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.
  6. For more information, please refer to http://www.zkoss.org/javadoc/7.0.1/jsdoc/zul/ContainerWidget.html
  7. For more information, please refer to ZK Component Reference Tablet Devices: Listbox, ZK Component Reference Tablet Devices: Grid, ZK Component Reference Tablet Devices: Tree.
  8. For more information, please refer to http://tracker.zkoss.org/browse/ZK-1285

Version History

Last Update : 2014/04/07


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



Last Update : 2014/04/07

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