org.openfaces.util
Class AjaxUtil

java.lang.Object
  extended by org.openfaces.util.AjaxUtil

public class AjaxUtil
extends java.lang.Object


Field Summary
static java.lang.String CUSTOM_JSON_PARAM
           
static java.lang.String KEY_RENDERING_PORTLETS_AJAX_RESPONSE
           
static java.lang.String UPDATE_PORTIONS_SUFFIX
           
 
Constructor Summary
AjaxUtil()
           
 
Method Summary
static java.util.List<java.lang.String> getAjaxPortionNames(javax.faces.context.FacesContext context)
           
static JSONObject getCustomJSONParam(javax.faces.context.FacesContext context)
           
static boolean getSkipExtraRenderingOnPortletsAjax(javax.faces.context.FacesContext context)
           
static boolean isAjax4jsfRequest()
           
static boolean isAjaxPortionRequest(javax.faces.context.FacesContext context)
           
static boolean isAjaxPortionRequest(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          This method should be used by components to ensure the correct lifecycle of using Ajax under Portlets.
static boolean isAjaxRequest(javax.faces.context.FacesContext context)
           
static boolean isPortletRenderRequest(javax.faces.context.FacesContext context)
           
static boolean isPortletRequest(javax.faces.context.FacesContext context)
           
static boolean isRenderingPortletsAjaxResponse(javax.faces.context.FacesContext context)
           
static void prepareComponentForAjax(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
static void renderAjaxSupport(javax.faces.context.FacesContext context)
           
static void renderJSLinks(javax.faces.context.FacesContext context)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_PORTIONS_SUFFIX

public static final java.lang.String UPDATE_PORTIONS_SUFFIX
See Also:
Constant Field Values

CUSTOM_JSON_PARAM

public static final java.lang.String CUSTOM_JSON_PARAM
See Also:
Constant Field Values

KEY_RENDERING_PORTLETS_AJAX_RESPONSE

public static final java.lang.String KEY_RENDERING_PORTLETS_AJAX_RESPONSE
Constructor Detail

AjaxUtil

public AjaxUtil()
Method Detail

isAjax4jsfRequest

public static boolean isAjax4jsfRequest()

isAjaxRequest

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

isPortletRequest

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

isPortletRenderRequest

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

prepareComponentForAjax

public static void prepareComponentForAjax(javax.faces.context.FacesContext context,
                                           javax.faces.component.UIComponent component)

renderJSLinks

public static void renderJSLinks(javax.faces.context.FacesContext context)

renderAjaxSupport

public static void renderAjaxSupport(javax.faces.context.FacesContext context)
                              throws java.io.IOException
Throws:
java.io.IOException

getSkipExtraRenderingOnPortletsAjax

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

isRenderingPortletsAjaxResponse

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

isAjaxPortionRequest

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

isAjaxPortionRequest

public static boolean isAjaxPortionRequest(javax.faces.context.FacesContext context,
                                           javax.faces.component.UIComponent component)
This method should be used by components to ensure the correct lifecycle of using Ajax under Portlets. The specifics of Ajax under Portlets is that as opposed to other configurations, component's encoding functions are invoked even if the ajax request is sent to render the component's portions only. The components which can potentially have a problem with such double rendering should invoke this method and skip the rendering functions if the current is an Ajax portion request.

Returns:
true if the current request is an ajax request for retrieving portions from the specified component. This method performs its primary job only during the render phase under portlets. In other conditions it always returns false.

getCustomJSONParam

public static JSONObject getCustomJSONParam(javax.faces.context.FacesContext context)

getAjaxPortionNames

public static java.util.List<java.lang.String> getAjaxPortionNames(javax.faces.context.FacesContext context)


Copyright © 1998-2010 TeamDev Ltd. All Rights Reserved.