Project Wonder 5.0.0.8658

er.ajax
Class AjaxExpansion

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by er.ajax.AjaxComponent
              extended by 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)
           

Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent
WOComponent._EventLoggingEnabler, WOComponent.Event
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
 
Fields inherited from class er.ajax.AjaxComponent
log
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations, MINUSONE
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSValidation
_CLASS
 
Constructor Summary
AjaxExpansion(WOContext context)
           
 
Method Summary
protected  void addRequiredWebResources(WOResponse response)
          Override this method to append the needed scripts for this component.
 WOActionResults handleRequest(WORequest request, WOContext context)
          Override this method to return the response for an Ajax request.
 String id()
           
 boolean isExpanded()
           
 String linkClass()
           
 String linkID()
           
 void setExpanded(boolean expanded)
           
 String string()
           
 boolean synchronizesVariablesWithBindings()
           
 WOActionResults toggle()
           
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AjaxExpansion

public AjaxExpansion(WOContext context)
Method Detail

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()

Last updated: Fri, Nov 21, 2008 • 04:36 AM EST

Copyright © 2002 – 2007 Project Wonder.