org.apache.myfaces.trinidad.render
Interface ExtendedRenderKitService


public interface ExtendedRenderKitService

Service implemented by RenderKits that provide further support for per-page rendering actions, like including scripts global to a page or short-circuiting rendering altogether. Developers should always retrieve an instance using Service.getService(java.lang.Object, java.lang.Class), passing in the current RenderKit, or with Service.getRenderKitService(javax.faces.context.FacesContext, java.lang.Class),

Example: The following code will add a script to be rendered during the following request:

    ExtendedRenderKitService service = 
      Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
    service.addScript(facesContext, "alert('foo');");
 


Method Summary
 void addScript(FacesContext context, String script)
          Adds a script for execution during rendering.
 void encodeBegin(FacesContext context)
          Called when the encoding of a page begins.
 void encodeEnd(FacesContext context)
          Called when the encoding of a page ends, if there were no exceptions.
 void encodeFinally(FacesContext context)
          Called when the encoding of a page completes, whether or not there were exceptions.
 void encodeScripts(FacesContext context)
          Output any needed scripts required by the RenderKit for this page.
 boolean isStateless(FacesContext context)
           
 boolean shortCircuitRenderView(FacesContext context)
          Called to short-circuit rendering the view.
 

Method Detail

addScript

void addScript(FacesContext context,
               String script)
Adds a script for execution during rendering.


encodeScripts

void encodeScripts(FacesContext context)
                   throws IOException
Output any needed scripts required by the RenderKit for this page.

Throws:
IOException

shortCircuitRenderView

boolean shortCircuitRenderView(FacesContext context)
                               throws IOException
Called to short-circuit rendering the view. A ViewHandler should call this method before rendering the view (for example, before forwarding to a JSP), and if it returns true, do nothing further.

Throws:
IOException

isStateless

boolean isStateless(FacesContext context)

encodeBegin

void encodeBegin(FacesContext context)
                 throws IOException
Called when the encoding of a page begins.

Throws:
IOException

encodeEnd

void encodeEnd(FacesContext context)
               throws IOException
Called when the encoding of a page ends, if there were no exceptions.

Throws:
IOException

encodeFinally

void encodeFinally(FacesContext context)
Called when the encoding of a page completes, whether or not there were exceptions.



Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.