Spring Web Flow

org.springframework.faces.ui
Class ProgressiveCommandLinkRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.springframework.faces.ui.BaseComponentRenderer
          extended by org.springframework.faces.ui.BaseSpringJavascriptComponentRenderer
              extended by org.springframework.faces.ui.BaseDojoComponentRenderer
                  extended by org.springframework.faces.ui.ProgressiveCommandButtonRenderer
                      extended by org.springframework.faces.ui.ProgressiveCommandLinkRenderer

public class ProgressiveCommandLinkRenderer
extends ProgressiveCommandButtonRenderer

Renderer for the <sf:commandLink> tag.

This renderer is unique in that it first renders a button that will still work if JavaScript is disabled on the client, then progressively enhances the button and transforms it into a link if JavaScript is available.

Author:
Jeremy Grelle

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Fields inherited from class javax.faces.render.Renderer
PASSTHROUGH_RENDERER_LOCALNAME_KEY
 
Constructor Summary
ProgressiveCommandLinkRenderer()
           
 
Method Summary
 void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Renders the opening portion of the tag, prior to any children.
 void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Closes the tag after children have been rendered.
protected  java.lang.String encodeParamsAsArray(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected  java.util.Map getAttributeAliases(javax.faces.component.UIComponent component)
           
protected  java.util.Map getAttributeCallbacks(javax.faces.component.UIComponent component)
           
protected  java.lang.String[] getAttributesToRender(javax.faces.component.UIComponent component)
           
protected  java.lang.String getOnClickNoAjax(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          This is a hook for subclasses to provide special onclick behavior in the non-ajax case
protected  java.lang.String getRenderedTagName(javax.faces.component.UIComponent component)
           
 boolean getRendersChildren()
           
protected  void writeAttributes(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Writes the attributes for this tag.
 
Methods inherited from class org.springframework.faces.ui.ProgressiveCommandButtonRenderer
decode, encodeParamsAsObject
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log
Constructor Detail

ProgressiveCommandLinkRenderer

public ProgressiveCommandLinkRenderer()
Method Detail

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context,
                        javax.faces.component.UIComponent component)
                 throws java.io.IOException
Renders the opening portion of the tag, prior to any children.

Overrides:
encodeBegin in class BaseDojoComponentRenderer
Throws:
java.io.IOException

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
                    throws java.io.IOException
Overrides:
encodeChildren in class javax.faces.render.Renderer
Throws:
java.io.IOException

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context,
                      javax.faces.component.UIComponent component)
               throws java.io.IOException
Closes the tag after children have been rendered.

Throws:
java.io.IOException

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class ProgressiveCommandButtonRenderer

getAttributesToRender

protected java.lang.String[] getAttributesToRender(javax.faces.component.UIComponent component)
Overrides:
getAttributesToRender in class ProgressiveCommandButtonRenderer
Returns:
an array of the tag attributes to be rendered

getRenderedTagName

protected java.lang.String getRenderedTagName(javax.faces.component.UIComponent component)
Overrides:
getRenderedTagName in class ProgressiveCommandButtonRenderer
Parameters:
component - TODO
Returns:
the name of the tag to be rendered.

getAttributeCallbacks

protected java.util.Map getAttributeCallbacks(javax.faces.component.UIComponent component)
Overrides:
getAttributeCallbacks in class ProgressiveCommandButtonRenderer
Returns:
a map of registered RenderAttributeCallbacks for attributes that require special rendering logic

getOnClickNoAjax

protected java.lang.String getOnClickNoAjax(javax.faces.context.FacesContext context,
                                            javax.faces.component.UIComponent component)
Description copied from class: ProgressiveCommandButtonRenderer
This is a hook for subclasses to provide special onclick behavior in the non-ajax case

Overrides:
getOnClickNoAjax in class ProgressiveCommandButtonRenderer
Returns:
the onclick value to use when Ajax is disabled.

encodeParamsAsArray

protected java.lang.String encodeParamsAsArray(javax.faces.context.FacesContext context,
                                               javax.faces.component.UIComponent component)

writeAttributes

protected void writeAttributes(javax.faces.context.FacesContext context,
                               javax.faces.component.UIComponent component)
                        throws java.io.IOException
Writes the attributes for this tag.

Parameters:
context - the current FacesContext
component - the UIComponent being rendered
Throws:
java.io.IOException

getAttributeAliases

protected java.util.Map getAttributeAliases(javax.faces.component.UIComponent component)
Returns:
a map that returns the bean property name for any attribute that doesn't map directly (i.e., the 'class' attribute maps to the 'styleClass' bean property)

Spring Web Flow