Actions and Effects"

From Documentation
m (Created page with '{{ZKDevelopersReferencePageHeader}} [since 5.0.6] =Version History= {{LastUpdated}} {| border='1px' | width="100%" ! Version !! Date !! Content |- | 5.0.6 | December 2010 | Ac…')
 
Line 1: Line 1:
 
{{ZKDevelopersReferencePageHeader}}
 
{{ZKDevelopersReferencePageHeader}}
 +
 +
__TOC__
  
 
  [since 5.0.6]
 
  [since 5.0.6]
 +
 +
The client-side action (CSA) is used to control how to perform an action at the client. Typical use is to control the effect of showing or hiding a widget. For example, with CSA, you could use the so-called ''slide-down'' effect to display a widget.
 +
 +
It is a generic feature available to <javadoc>org.zkoss.zk.ui.HtmlBasedComponent</javadoc>, so you could apply to almost all widgets.
 +
 +
CSA allows the developer to control some actions without JavaScript. If you want to have the full control (and are OK to write some JavaScript code), please refer to [[ZK Client-side Reference/General Control|ZK Client-side Reference]] for the complete control of the client-side behavior.
 +
 +
= How to Apply CSA =
 +
 +
To apply the client-side action to a widget, you have to assign a value to the <code>action</code> property (<javadoc method="setAction(java.lang.String)">org.zkoss.zk.ui.HtmlBasedComponent</javadoc>). The syntax of the value is as follows.
 +
 +
''action-name1'': ''action-op1''; ''action-name2'': ''action-op2''
 +
 +
The name of the action (e.g., <code>action1</code>) is either <code>show</code> or <code>hide</code>.
 +
 +
= Notes for Upgrading from ZK 3 =
 +
 +
They are both called Client-side Actions, but they are different and you have to rewrite them to make it work under ZK 5:
 +
 +
# The action names was changed and the support is limited to <code>show</code> and <code>hide</code> (while ZK 3 supports any <code>onxxx</code>).
 +
# The action operation is the name of the method in <javadoc directory="jsdoc">zk.eff.Actions</javadoc> (while ZK 3 is the JavaScript code).
 +
# It is part of <javadoc>org.zkoss.zk.ui.HtmlBasedComponent</javadoc> (while ZK 3 is <javadoc>org.zkoss.zul.impl.XulElement</javadoc>).
  
 
=Version History=
 
=Version History=

Revision as of 04:57, 27 December 2010


Actions and Effects


[since 5.0.6]

The client-side action (CSA) is used to control how to perform an action at the client. Typical use is to control the effect of showing or hiding a widget. For example, with CSA, you could use the so-called slide-down effect to display a widget.

It is a generic feature available to HtmlBasedComponent, so you could apply to almost all widgets.

CSA allows the developer to control some actions without JavaScript. If you want to have the full control (and are OK to write some JavaScript code), please refer to ZK Client-side Reference for the complete control of the client-side behavior.

How to Apply CSA

To apply the client-side action to a widget, you have to assign a value to the action property (HtmlBasedComponent.setAction(String)). The syntax of the value is as follows.

action-name1: action-op1; action-name2: action-op2

The name of the action (e.g., action1) is either show or hide.

Notes for Upgrading from ZK 3

They are both called Client-side Actions, but they are different and you have to rewrite them to make it work under ZK 5:

  1. The action names was changed and the support is limited to show and hide (while ZK 3 supports any onxxx).
  2. The action operation is the name of the method in Actions (while ZK 3 is the JavaScript code).
  3. It is part of HtmlBasedComponent (while ZK 3 is XulElement).

Version History

Last Update : 2010/12/27


Version Date Content
5.0.6 December 2010 Actions were introduced since 5.0.6



Last Update : 2010/12/27

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