Effects and Popups
There are many tacos components ( AjaxDirectLink, AjaxSubmit, AjaxForm, AjaxLinkSubmit and AjaxEventSubmit ) that accept the effects, preEffects and popup parameters.
Effects
Specifies a list of effects to be applied to the returned response, being identified by one of three criteria:
- Component ID - The unique id of the component
- Element ID - The unique id of the html element
- Any keyword - Effect will be applied to all response blocks, unless a specific effect has been specified for a particular component/element id.
All of the effects come from the dojo.fx dojo package. The parameter string is specified in the form of a javascript structure and its general structure is: {[effect name]:{[comp/elm id]:[parameters]}}
The currently available effects are:
Name | Parameters |
---|---|
highlight |
{[comp/elm id]:'[r,g,b],[delay in millis], [duration in millis]'}
|
fadeshow |
{[comp/elm id]:'[duration in millis]'}
|
fadehide |
{[comp/elm id]:'[duration in millis]'}
|
fadein |
{[comp/elm id]:'[duration in millis]'}
|
fadeout |
{[comp/elm id]:'[duration in millis]'}
|
fade
Warning
Removed in dojo 0.3.1 - use fadein or fadeout
|
{[comp/elm id]:'[duration in millis],[oppacityFrom],[oppacityTo]'}
|
wipein |
{[comp/elm id]:'[duration]'}
|
wipeout |
{[comp/elm id]:'[duration]'}
|
explode |
{[comp/elm id]:'[nodeIdFrom], [nodeIdTo], [duration]'}
|
implode |
{[comp/elm id]:'[nodeIdFrom], [nodeIdTo], [duration]'}
|
slideto |
{[comp/elm id]:'[endCoords], [duration]'}
|
slideby |
{[comp/elm id]:'[coords], [duration]'}
|
slide
Warning
Removed in dojo 0.3.1 - use slideto or slideby
|
{[comp/elm id]:'[duration], [startCoords], [endCoords]'}
|
Example usage
<binding name="effects"> template:{highlight:{ selectedCountries:'[255,255,184], 500, 500', '${currItem}':'[255,255,184], 500, 500' }} </binding>
PreEffects
Specifies a list of effects to be applied on the given elements before the ajax request is triggered. The syntax and the available effects are the same as the ones described on the previous section.
For instance, if one tries a fadehide preEffect followed by a fadeshow effect then only the fadehide will get executed. This happens because fadehide fades out an element and then completely removes it from the document tree. In this case, the solution is to do a fade from opacity 1 to 0 instead of a fadehide.
Popup
If specified, the updated content will be shown in a floating pane. This property defines a list of key-value parameters, some of which are used by dojo's FloatingPane and some by Tacos.
Dojo's FloatingPane Parameters
Name | Description |
---|---|
title | The title of the widget. |
widgetId | The unique id of the widget. |
constrainToContainer | Specifies if the widget is constrained to it's container. |
toggle | Sets the effect when showing and hiding the widget. Use one of: plain, fade, explode. |
resizable | if true, the widget is resizable. |
Tacos used Parameters
Name | Description |
---|---|
persistenceWidgetPosition | If true, the widget's left, top, width, height will be stored in a cookie, and be loaded on next usage. |
contentNodeId | The updated component will be displayed in this node. |
style | Sets the style of the widget. |
class | Sets the class of the widget. |
Example usage
<binding name="popup"> literal:{ title:"Countries", widgetId:"selectCountryAreaWID", constrainToContainer:true, toggle:'fade', hasShadow:true, resizable:true, persistenceWidgetPosition: false, contentNodeId:'selectCountryArea', style:'width: 360px; height: 480px; left: 100px; top: 100px' } </binding>