er.ajax
Class AjaxExpansion
java.lang.Object
com.webobjects.appserver.WOElement
com.webobjects.appserver.WOComponent
er.ajax.AjaxComponent
er.ajax.AjaxExpansion
- All Implemented Interfaces:
- WOActionResults, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, IAjaxElement, Serializable, Cloneable
public class AjaxExpansion
- extends AjaxComponent
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
- See Also:
- Serialized Form
| Bindings |
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 |
string | the string displayed for the link. For something fancier than a plain string, see above. |
insertion | the insertion effect (see AjaxUpdateLink) |
insertionDuration | the insertion effect duration (see AjaxUpdateLink) |
action | the action to fire when the contents are expanded |
accesskey | hot key that should toggle the expansion (optional) |
| Methods inherited from class er.ajax.AjaxComponent |
_containerID, addScriptResourceInHead, addScriptResourceInHead, addStylesheetResourceInHead, addStylesheetResourceInHead, appendTagAttributeToResponse, appendToResponse, booleanValueForBinding, invokeAction, safeElementID, valueForBinding, valueForBinding, valueForBinding |
| Methods inherited from class com.webobjects.appserver.WOComponent |
__valueForBinding, _associationWithName, _awakeInContext, _childTemplate, _cleanUpStatelessComponent, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, reset, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, takeValueForKey, takeValueForKeyPath, takeValuesFromRequest, template, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding |
AjaxExpansion
public AjaxExpansion(WOContext context)
synchronizesVariablesWithBindings
public boolean synchronizesVariablesWithBindings()
- Overrides:
synchronizesVariablesWithBindings in class WOComponent
linkID
public String linkID()
linkClass
public String linkClass()
id
public String id()
string
public String string()
addRequiredWebResources
protected void addRequiredWebResources(WOResponse response)
- Description copied from class:
AjaxComponent
- Override this method to append the needed scripts for this component.
- Specified by:
addRequiredWebResources in class AjaxComponent
handleRequest
public WOActionResults handleRequest(WORequest request,
WOContext context)
- Description copied from class:
AjaxComponent
- Override this method to return the response for an Ajax request.
- Specified by:
handleRequest in interface IAjaxElement- Specified by:
handleRequest in class AjaxComponent
isExpanded
public boolean isExpanded()
setExpanded
public void setExpanded(boolean expanded)
toggle
public WOActionResults toggle()
Copyright © 2002 – 2007 Project Wonder.