com.esri.adf.web.faces.renderkit.xml.ajax
Class AJAXResponseRenderer

java.lang.Object
  extended by com.esri.adf.web.faces.renderkit.xml.ajax.AJAXResponseRenderer

public class AJAXResponseRenderer
extends Object

The AJAXResponseRenderer class is responsible for iterating through the elements in a form and calling the appropriate AJAXRenderer to render its state to XML. This XML is then returned to the client which is parsed and appropriate updates are made.

 Vector eventSources = new Vector();
 ... add event source id ...
 AJAXResponseRenderer renderer = new AJAXResponseRenderer(facesContext, eventSources, form);
 ... do processing ...
 webContext.refresh(); //update application
 Document doc = renderer.renderResponse(facesContext);
 AJAXUtil.writeResponse(FacesContext, Document)
 facesContext.responseComplete();
 


Constructor Summary
AJAXResponseRenderer(javax.faces.context.FacesContext facesContext, Vector<String> eventSourceIds, javax.faces.component.UIComponent form)
           Creates a new instance of AJAXResponseRenderer and store the state of the components within the argument form.
 
Method Summary
 Vector<String> getEventSourceIds()
           Ids of component(s) passed when constructing this object.
 Document renderResponse(javax.faces.context.FacesContext facesContext)
           Once the updates have been made to the components, calling this method calls all registered AJAXRenderers renderAjaxResponse method to allow these to render the content appropriately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AJAXResponseRenderer

public AJAXResponseRenderer(javax.faces.context.FacesContext facesContext,
                            Vector<String> eventSourceIds,
                            javax.faces.component.UIComponent form)
                     throws Exception

Creates a new instance of AJAXResponseRenderer and store the state of the components within the argument form. The response renderer object must be instantiated before the change of the application is triggered.

During initialization, this object retrieves the AJAXRenderers from the list specified in the WEB-INF/ajax-renderers.xml. The getOriginalState method is called on each of these renderers.

Parameters:
facesContext - Current FacesContext instance
eventSourceIds - Ids of control(s) which are expected to perform actions to trigger updates. Can be empty.
form - HTMLForm element containing controls to update

Throws:
Exception
Method Detail

renderResponse

public Document renderResponse(javax.faces.context.FacesContext facesContext)
                        throws Exception

Once the updates have been made to the components, calling this method calls all registered AJAXRenderers renderAjaxResponse method to allow these to render the content appropriately. This method will add the serialized view ID to form element. In order to get the latest view id, in your PhaseListener.afterPhase(), you should put this method as near the facesContext.responseComplete() as possible.

Parameters:
facesContext - Current FacesContext instance
Returns:
Document XML document representing the state of the changed components in the form.

Throws:
Exception

getEventSourceIds

public Vector<String> getEventSourceIds()

Ids of component(s) passed when constructing this object.

Returns:
java.util.Vector List of Ids