er.ajax
Class AjaxObserveField
java.lang.Object
com.webobjects.appserver.WOElement
com.webobjects.appserver.WODynamicElement
com.webobjects.appserver._private.WODynamicGroup
er.ajax.AjaxDynamicElement
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) |
|
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 |
AjaxObserveField
public AjaxObserveField(String name,
NSDictionary associations,
WOElement children)
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
Copyright © 2002 – 2007 Project Wonder.