AnimationSince 2.0 ICEFaces provides a way to animate standard JSF components as well by using the <ace:animation> attachable behavior. It works by nesting the <ace:animation> tag inside the component. Then, in this tag one specifies the event name that will trigger the animation. This event must be supported by the component. The TLD documentation of each standard JSF component lists which events are supported, which usually map to standard DOM events. The event name must be entered without the 'on' prefix. For example, for 'onmousemove' the value of the 'event' attribute must be 'mousemove'. Also the event attribute does not support EL expressions, its value can be only a literal defined in the template. Finally, the animation parameters are specified in the desired way, as described below.
- There are two different type of animations:
* Predefined: Blind - Blinds the element away or shows it by blinding it in. In order to use predefined animations a developer needs to define an animation "name" as well as a type of "event". For example: <h:inputText> <ace:animation event="click" name="highlight" /> </h:inputText> * Free form: <h:inputText> <ace:animation event="change" from="{color:'black'}" to="{color:'red'}" /> </h:inputText> or: <h:inputTextarea> <ace:animation event="mouseover" from="{height:20, color:'#222'}" to="{height:100, color:'#CCC'}" /> <ace:animation event="mouseout" to="{height:20, color:'#222'}" from="{height:100, color:'#CCC'}" /> </h:inputTextarea> When using free form animation the name of an animation is not required, but it can be defined as "anim". - With the current implementation "to" and "from" will only be applied when using "anim (free form)" type of animation, and if using predefine animation such as "fade" or "highlight" then "to" and "from" can be changed using the style classas shown above. * Chaining: <h:panelGroup> <ace:animation event="click" name="fade"/> <ace:animation event="click" name="highlight"/> ..... * Synchronize execution of animations: <h:panelGroup> <ace:animation event="click" from="{opacity:1, height:20}" to="{opacity:0, height:1}"/> ..... The above snippet will give blind up/down effect in parallel to fade in/out Other Animation Attributes: easing iterations Number of times the animation is to repeat. duration Length of effect in milliseconds. |
Animation
© Copyright 2021 ICEsoft Technologies Canada Corp.