AjaxObserveField Class Reference

Inherits er::ajax::AjaxDynamicElement.

Collaboration diagram for AjaxObserveField:

Collaboration graph
base refererrect $classer_1_1ajax_1_1_ajax_dynamic_element.html 7,83 156,107rect $interfaceer_1_1ajax_1_1_i_ajax_element.html 31,8 132,32
[legend]

List of all members.

Public Member Functions

 AjaxObserveField (String name, NSDictionary associations, WOElement children)
void appendToResponse (WOResponse response, WOContext context)
NSMutableDictionary createAjaxOptions (WOComponent component)
WOActionResults handleRequest (WORequest request, WOContext context)
WOActionResults invokeAction (WORequest worequest, WOContext wocontext)

Static Public Member Functions

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

Protected Member Functions

void addRequiredWebResources (WOResponse response, WOContext context)


Detailed Description

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 none fields inside of the container will be observed after an update. Instead, AjaxObserveFields should be surrounded by an update container.

If you set an observeFieldID you must place the AjaxObserveField tag after the field you would like to observe.

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, so you will get an extra dom element when used as a container.

AjaxObserveFields observe specific instances of DOM elements. If you ajax replace the DOM elements being watched, the observe field will cease to function. To prevent this problem, you should always ensure that any ajax update of an observed field also updates the AjaxObserveField component as well. The rule of thumb is that all AjaxObserveFields should be in the same AjaxUpdateContainer as the fields they observe.

id the ID of the observe field container (only useful if you leave off observeFieldID). elementName element to use for the observe field container. Defaults to div. (Only used if you leave off observeFieldID) observeFieldID the ID of the field to observe updateContainerID the ID of the container to update. Specify "_parent" to use the nearest one. 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) fullSubmit When false, only the value of the field that changed is sent to the server (partial submit), when true, the whole form is sent. Defaults to false. Caution: Partial submit doesn't work correctly if you manually set the name on your inputs. class CSS class to use on the container. (Only used if you leave off observeFieldID) style CSS style to use on the container. (Only used if you leave off observeFieldID) onCreate Takes a JavaScript function which is called after the form has been serialized, but befor the Ajax request is sent to the server. Useful e.g. if you want to disable the form while the ajax request is running.


Constructor & Destructor Documentation

AjaxObserveField ( String  name,
NSDictionary  associations,
WOElement  children 
)


Member Function Documentation

void addRequiredWebResources ( WOResponse  response,
WOContext  context 
) [protected, virtual]

Adds all required resources.

Implements AjaxDynamicElement.

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

void appendToResponse ( WOResponse  response,
WOContext  context 
)

Overridden to call addRequiredWebResources(WOResponse, WOContext).

Reimplemented from AjaxDynamicElement.

NSMutableDictionary createAjaxOptions ( WOComponent  component  ) 

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

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

Parameters:
request 
context 

Implements AjaxDynamicElement.

WOActionResults invokeAction ( WORequest  request,
WOContext  context 
)

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

Reimplemented from AjaxDynamicElement.

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


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