Client Attribute"

From Documentation
(Created page with '{{ZUMLReferencePageHeader}} Name: client attribute Namespace: http://www.zkoss.org/2005/zk/client/attribute Namespace shortcut: client/attribute It is the reserved namespace…')
 
Line 5: Line 5:
 
  Namespace shortcut: client/attribute
 
  Namespace shortcut: client/attribute
  
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 to the DOM tree directly.
+
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.
 +
 
 +
<blockquote>
 +
----
 +
Notice that if the widget's DOM output (<javadoc directory="jsdoc" method="redraw()">zk.Wdiget</javadoc>) 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.
 +
</blockquote>
 +
 
 +
For example, suppose you want to listen to the <code>onload</code> event, and then you can do as follows.
 +
 
 +
<source lang="xml">
 +
<iframe src="http://www.google.com" width="100%" height="300px"
 +
  xmlns:ca="client/attribute"
 +
  ca:onload="do_whater_you_want()"/>
 +
</source>
 +
 
 +
If the attribute contains colon or other special characters, you can use the <code>attribute</code> element as follows.
 +
 
 +
<source lang="xml">
 +
<div xmlns:ca="client/attribute">
 +
  <attribute ca:name="ns:whatever">
 +
  whatever_value_you_want
 +
  </attribute>
 +
</div>
 +
</source>
 +
 
 +
The other use of the client-attribute namespace is to specify attributes that are available only to certain browsers, such as accessibility and [http://www.section508.gov/index.cfm?FuseAction=Content&ID=12#Web Section 508].
  
 
=Version History=
 
=Version History=
Line 12: Line 37:
 
! Version !! Date !! Content
 
! Version !! Date !! Content
 
|-
 
|-
| &nbsp;
+
| 5.0.3
| &nbsp;
+
| July 2010
| &nbsp;
+
| The client-attribute namespace was introduced.
 
|}
 
|}
  
 
{{ZUMLReferencePageFooter}}
 
{{ZUMLReferencePageFooter}}

Revision as of 07:44, 7 December 2010


Client Attribute


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

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 (Wdiget.redraw()) 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.

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

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.

Version History

Last Update : 2010/12/7

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



Last Update : 2010/12/07

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