AjaxExpansion Class Reference

Inherits er::ajax::AjaxComponent.

Collaboration diagram for AjaxExpansion:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 AjaxExpansion (WOContext context)
WOActionResults handleRequest (WORequest request, WOContext context)
String id ()
boolean isExpanded ()
String jsEscapedString ()
String linkClass ()
String linkID ()
String onExpansionComplete ()
void setExpanded (boolean expanded)
String string ()
boolean synchronizesVariablesWithBindings ()
WOActionResults toggle ()

Protected Member Functions

void addRequiredWebResources (WOResponse response)

Private Attributes

Boolean _expanded
String _id


Detailed Description

AjaxExpansion provides an easy way to make expansion areas that appear and disappear by clicking a link (for instance, expandable options areas). The simple implementation of an expansion area would include wrapping the toggle link in the AjaxUpdateContainer. The problem with this approach is that if you want to animate the appearance of the contents, the animation effects the link as well as the contents. AjaxExpansion instead only updates the contents and applies an "expanded" class to the link, which you can use to change the expansion icon in a stylesheet (see AjaxExample2's ToggleDetails example).

If you want to use something fancier than a string as link label, you can put a ERXWOTemplate with templateName='label' inside the component. If present, that will replace the label provided by the 'string' binding.

Author:
mschrag id the id of the contents div linkID the id of the toggle link (defaults to "[id]Link") class the class of the contents div linkClass the class of the toggle link (always gets "expansion" added, and "expanded" when opened) expanded optionally allows controlling the expansion state of the contents initiallyExpanded optionally allows controlling the initial expansion state when the "expanded" binding is NOT used string the string displayed for the link. For something fancier than a plain string, see above. openedLabel the string to display when expanded. An alternative to the 'string' binding. closedLabel the string to display when not expanded. An alternative to the 'string' binding. insertion the insertion effect (see AjaxUpdateLink) insertionDuration the insertion effect duration (see AjaxUpdateLink) action the action to fire when the contents are expanded onLoading JavaScript function to evaluate when the update request begins onComplete JavaScript function to evaluate when the update request has finished. onSuccess JavaScript function to evaluate when the update request was successful. onFailure JavaScript function to evaluate when the update request has failed. onException JavaScript function to evaluate when the update request had errors. accesskey hot key that should toggle the expansion (optional) onExpansionComplete value for the AjaxUpdateContainer onRefreshComplete binding when the contents are expanded

Constructor & Destructor Documentation

AjaxExpansion ( WOContext  context  ) 


Member Function Documentation

void addRequiredWebResources ( WOResponse  res  )  [protected, virtual]

Override this method to append the needed scripts for this component.

Parameters:
res 

Implements AjaxComponent.

WOActionResults handleRequest ( WORequest  request,
WOContext  context 
) [virtual]

Override this method to return the response for an Ajax request.

Parameters:
request 
context 

Implements AjaxComponent.

String id (  ) 

boolean isExpanded (  ) 

String jsEscapedString (  ) 

String linkClass (  ) 

String linkID (  ) 

String onExpansionComplete (  ) 

void setExpanded ( boolean  expanded  ) 

String string (  ) 

boolean synchronizesVariablesWithBindings (  ) 

WOActionResults toggle (  ) 


Member Data Documentation

Boolean _expanded [private]

String _id [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:38 2012 for Project Wonder by  doxygen 1.5.8