Project Wonder 5.0.0.8658

er.ajax
Class AjaxObserveField

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WODynamicElement
          extended by com.webobjects.appserver._private.WODynamicGroup
              extended by er.ajax.AjaxDynamicElement
                  extended by er.ajax.AjaxObserveField
All Implemented Interfaces:
IAjaxElement

public class AjaxObserveField
extends AjaxDynamicElement

AjaxObserveField allows you to perform an Ajax submit (and optional update) based on the state of a form field changing. If you specify an observeFieldID, that single field will be observed for changes. If you also specify an updateContainerID, the given container will be refreshed after the field changes. If you do NOT specify an observeFieldID, all of the form fields contained within this component will be observed for changes instead. The list of form fields to observe is obtained on the client side, so you should not put AjaxUpdateContainers INSIDE of this component or any fields inside of the container will no be observed after an update. Instead, AjaxObserveFields should be surrounded by a container. If you leave of observeFieldID, AjaxObserveField must generate an HTML container, so that it can find the form fields that correspond to this component from the client side.

Bindings
id the ID of the observe field container (only useful if you leave off observeFieldID).
           
elementName the name of the html tag to generate with observeFieldID if it is null, uses div by default.
           
observeFieldID the ID of the field to observe
           
updateContainerID the ID of the container to update
           
action the action to call when the observer fires
           
onBeforeSubmit called prior to submitting the observed content; return false to deny the submit
           
observeFieldFrequency the polling observe frequency (in seconds)
           
observeDelay the minimum time between submits (in seconds)
           

Field Summary
 
Fields inherited from class er.ajax.AjaxDynamicElement
log
 
Fields inherited from class com.webobjects.appserver.WODynamicElement
_ConstructorParameters
 
Constructor Summary
AjaxObserveField(String name, NSDictionary associations, WOElement children)
           
 
Method Summary
protected  void addRequiredWebResources(WOResponse response, WOContext context)
          Adds all required resources.
 void appendToResponse(WOResponse response, WOContext context)
          Overridden to call #addRequiredWebResources(WOResponse).
static void appendToResponse(WOResponse response, WOContext context, AjaxDynamicElement element, String observeFieldID, boolean observeDescendentFields, String updateContainerID, boolean fullSubmit, NSMutableDictionary options)
           
 NSMutableDictionary createAjaxOptions(WOComponent component)
           
 WOActionResults handleRequest(WORequest request, WOContext context)
          Override this method to return the response for an Ajax request.
 WOActionResults invokeAction(WORequest worequest, WOContext wocontext)
          Execute the request, if it's comming from our action, then invoke the ajax handler and put the key AJAX_REQUEST_KEY in the request userInfo dictionary (request.userInfo()).
static String nameInContext(WOContext context, WOComponent component, AjaxDynamicElement element)
           
 
Methods inherited from class er.ajax.AjaxDynamicElement
_containerID, addScriptResourceInHead, addScriptResourceInHead, addStylesheetResourceInHead, addStylesheetResourceInHead, appendTagAttributeToResponse, associations, bindingNamed, booleanValueForBinding, hasBinding, setValueForBinding, stringValueForBinding, takeValuesFromRequest, valueForBinding, valueForBinding
 
Methods inherited from class com.webobjects.appserver._private.WODynamicGroup
addChildElement, appendChildrenToResponse, childrenElements, EmptyGroup, hasChildrenElements, invokeChildrenAction, takeChildrenValuesFromRequest, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AjaxObserveField

public AjaxObserveField(String name,
                        NSDictionary associations,
                        WOElement children)
Method Detail

addRequiredWebResources

protected void addRequiredWebResources(WOResponse response,
                                       WOContext context)
Adds all required resources.

Specified by:
addRequiredWebResources in class AjaxDynamicElement

createAjaxOptions

public NSMutableDictionary createAjaxOptions(WOComponent component)

appendToResponse

public void appendToResponse(WOResponse response,
                             WOContext context)
Description copied from class: AjaxDynamicElement
Overridden to call #addRequiredWebResources(WOResponse).

Overrides:
appendToResponse in class AjaxDynamicElement

appendToResponse

public static void appendToResponse(WOResponse response,
                                    WOContext context,
                                    AjaxDynamicElement element,
                                    String observeFieldID,
                                    boolean observeDescendentFields,
                                    String updateContainerID,
                                    boolean fullSubmit,
                                    NSMutableDictionary options)

nameInContext

public static String nameInContext(WOContext context,
                                   WOComponent component,
                                   AjaxDynamicElement element)

invokeAction

public WOActionResults invokeAction(WORequest worequest,
                                    WOContext wocontext)
Description copied from class: AjaxDynamicElement
Execute the request, if it's comming from our action, then invoke the ajax handler and put the key AJAX_REQUEST_KEY in the request userInfo dictionary (request.userInfo()).

Overrides:
invokeAction in class AjaxDynamicElement

handleRequest

public WOActionResults handleRequest(WORequest request,
                                     WOContext context)
Description copied from class: AjaxDynamicElement
Override this method to return the response for an Ajax request.

Specified by:
handleRequest in interface IAjaxElement
Specified by:
handleRequest in class AjaxDynamicElement

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

Copyright © 2002 – 2007 Project Wonder.