com.ibm.xsp.ajax
Class AjaxUtil

java.lang.Object
  extended by com.ibm.xsp.ajax.AjaxUtil

public class AjaxUtil
extends java.lang.Object


Field Summary
static java.lang.String AJAX_AXTARGET
          This parameter contains the component id to delegate the Ajax request to.
static java.lang.String AJAX_COMPID
          This parameter contains the component id used in a partial refresh id.
static java.lang.String AJAX_MODE
          This parameter contains an optional mode that can be check by a component.
static java.lang.String AJAX_VIEWID
          This parameter contains the JSF view id to restore.
 
Constructor Summary
AjaxUtil()
           
 
Method Summary
static java.lang.String computeComponentId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
static FacesAjaxComponent getAjaxComponent(javax.faces.context.FacesContext context)
          Check if the request is an Ajax partial refresh request.
static java.lang.String getAjaxComponentId(javax.faces.context.FacesContext context)
          Return the Ajax component id associated with this FacesContext.
static java.lang.String getAjaxMode(javax.faces.context.FacesContext context)
          Get the request ajax mode.
static java.lang.String getAjaxUrl(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String pathInfo, java.lang.String ajaxId)
          Compose the URL for a Ajax request related to a component.
static void initRender(javax.faces.context.FacesContext context)
          Initialize the JSF objects before rendering som markup.
static boolean isAjaxNullResponseWriter(javax.faces.context.ResponseWriter rw)
          Check if the Nullwriter is used.
static boolean isAjaxPartialRefresh(javax.faces.context.FacesContext context)
          Check if the request is an Ajax partial refresh request.
static boolean isInRenderedChain(FacesContextEx context, javax.faces.component.UIComponent component)
          Check if a component is in the chain of the renderered one.
static boolean isRendered(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
static boolean isRendering(javax.faces.context.FacesContext context)
           
static void renderMarkup(javax.faces.context.FacesContext context, RenderCallback callback, boolean initRender)
          Render a piece of markup when executed in a Ajax request.
static void setRendering(javax.faces.context.FacesContext context, boolean rendering)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AJAX_VIEWID

public static final java.lang.String AJAX_VIEWID
This parameter contains the JSF view id to restore.

See Also:
Constant Field Values

AJAX_AXTARGET

public static final java.lang.String AJAX_AXTARGET
This parameter contains the component id to delegate the Ajax request to.

See Also:
Constant Field Values

AJAX_COMPID

public static final java.lang.String AJAX_COMPID
This parameter contains the component id used in a partial refresh id.

See Also:
Constant Field Values

AJAX_MODE

public static final java.lang.String AJAX_MODE
This parameter contains an optional mode that can be check by a component.

See Also:
Constant Field Values
Constructor Detail

AjaxUtil

public AjaxUtil()
Method Detail

isAjaxPartialRefresh

public static boolean isAjaxPartialRefresh(javax.faces.context.FacesContext context)
Check if the request is an Ajax partial refresh request.

Parameters:
context -
Returns:

getAjaxMode

public static java.lang.String getAjaxMode(javax.faces.context.FacesContext context)
Get the request ajax mode.

Parameters:
context -
Returns:

getAjaxComponentId

public static java.lang.String getAjaxComponentId(javax.faces.context.FacesContext context)
Return the Ajax component id associated with this FacesContext.


getAjaxComponent

public static FacesAjaxComponent getAjaxComponent(javax.faces.context.FacesContext context)
Check if the request is an Ajax partial refresh request.

Parameters:
context -
Returns:

computeComponentId

public static java.lang.String computeComponentId(javax.faces.context.FacesContext context,
                                                  javax.faces.component.UIComponent component)

isRendering

public static boolean isRendering(javax.faces.context.FacesContext context)

isRendered

public static boolean isRendered(javax.faces.context.FacesContext context,
                                 javax.faces.component.UIComponent component)

isInRenderedChain

public static boolean isInRenderedChain(FacesContextEx context,
                                        javax.faces.component.UIComponent component)
Check if a component is in the chain of the renderered one. If not, then the partial refresh engine will prevent this component to be rendered. This is an optimization that prevents some component to be rendered to the NullWriter, for nothing... It can have some side effects if the component before it were making data available to some scope, so this behavior is driven by a property. This behavior also rely the the way naming containers compose their id.

Parameters:
context -
component -
Returns:

setRendering

public static void setRendering(javax.faces.context.FacesContext context,
                                boolean rendering)

isAjaxNullResponseWriter

public static boolean isAjaxNullResponseWriter(javax.faces.context.ResponseWriter rw)
Check if the Nullwriter is used. This allows some renderer to not not try to render code when it is not needed.


getAjaxUrl

public static java.lang.String getAjaxUrl(javax.faces.context.FacesContext context,
                                          javax.faces.component.UIComponent component,
                                          java.lang.String pathInfo,
                                          java.lang.String ajaxId)
Compose the URL for a Ajax request related to a component.


initRender

public static void initRender(javax.faces.context.FacesContext context)
                       throws java.io.IOException
Initialize the JSF objects before rendering som markup.

Throws:
java.io.IOException

renderMarkup

public static void renderMarkup(javax.faces.context.FacesContext context,
                                RenderCallback callback,
                                boolean initRender)
                         throws java.io.IOException
Render a piece of markup when executed in a Ajax request. This delegates to the UIViewRoot to get the script being generated.

Throws:
java.io.IOException