org.alfresco.web.ui.repo.renderer
Class BaseMultiValueRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.alfresco.web.ui.common.renderer.BaseRenderer
          extended by org.alfresco.web.ui.repo.renderer.BaseMultiValueRenderer
Direct Known Subclasses:
MultiValueFieldRenderer, MultiValueSelectorRenderer

public abstract class BaseMultiValueRenderer
extends BaseRenderer

Base class for renderers of the MultiValueEditor component. The current items are displayed as a list of options that can be removed using a Remove button.


Field Summary
protected  boolean highlightedRow
           
protected static java.lang.String MSG_ADD_TO_LIST_BUTTON
           
protected static java.lang.String MSG_REMOVE
          I18N message strings
protected static java.lang.String MSG_SELECT_BUTTON
           
 
Constructor Summary
BaseMultiValueRenderer()
           
 
Method Summary
 void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected  java.lang.String generateFormSubmit(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String action)
          Generate FORM submit JavaScript for the specified action
protected  java.lang.String getHiddenFieldName(javax.faces.component.UIComponent component)
          We use a hidden field per picker instance on the page.
protected  void renderExistingItem(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.context.ResponseWriter out, org.alfresco.service.cmr.repository.NodeService nodeService, int index, java.lang.Object value)
          Renders an existing item with a remove button
protected abstract  void renderPostWrappedComponent(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter out, UIMultiValueEditor editor)
          Renders the area of the component after the wrapped component but before the list of currently selected values.
protected abstract  void renderPreWrappedComponent(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter out, UIMultiValueEditor editor)
          Renders the area of the component before the wrapped component appears.
 
Methods inherited from class org.alfresco.web.ui.common.renderer.BaseRenderer
assertParmeters, getParameterComponents, outputAttribute
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, encodeChildren, getConvertedValue, getRendersChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_REMOVE

protected static final java.lang.String MSG_REMOVE
I18N message strings

See Also:
Constant Field Values

MSG_SELECT_BUTTON

protected static final java.lang.String MSG_SELECT_BUTTON
See Also:
Constant Field Values

MSG_ADD_TO_LIST_BUTTON

protected static final java.lang.String MSG_ADD_TO_LIST_BUTTON
See Also:
Constant Field Values

highlightedRow

protected boolean highlightedRow
Constructor Detail

BaseMultiValueRenderer

public BaseMultiValueRenderer()
Method Detail

decode

public void decode(javax.faces.context.FacesContext context,
                   javax.faces.component.UIComponent component)
Overrides:
decode in class javax.faces.render.Renderer
See Also:
Renderer.decode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)

encodeBegin

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

encodeEnd

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

renderPreWrappedComponent

protected abstract void renderPreWrappedComponent(javax.faces.context.FacesContext context,
                                                  javax.faces.context.ResponseWriter out,
                                                  UIMultiValueEditor editor)
                                           throws java.io.IOException
Renders the area of the component before the wrapped component appears.

Parameters:
context - FacesContext
out - The ResponseWriter to write to
editor - The multi value editor component
Throws:
java.io.IOException

renderPostWrappedComponent

protected abstract void renderPostWrappedComponent(javax.faces.context.FacesContext context,
                                                   javax.faces.context.ResponseWriter out,
                                                   UIMultiValueEditor editor)
                                            throws java.io.IOException
Renders the area of the component after the wrapped component but before the list of currently selected values.

Parameters:
context - FacesContext
out - The ResponseWriter to write to
editor - The multi value editor component
Throws:
java.io.IOException

renderExistingItem

protected void renderExistingItem(javax.faces.context.FacesContext context,
                                  javax.faces.component.UIComponent component,
                                  javax.faces.context.ResponseWriter out,
                                  org.alfresco.service.cmr.repository.NodeService nodeService,
                                  int index,
                                  java.lang.Object value)
                           throws java.io.IOException
Renders an existing item with a remove button

Parameters:
context - FacesContext
component - The UIComponent
out - Writer to write output to
nodeService - The NodeService
index - The index of the item
value - The item's value
Throws:
java.io.IOException

getHiddenFieldName

protected java.lang.String getHiddenFieldName(javax.faces.component.UIComponent component)
We use a hidden field per picker instance on the page.

Returns:
hidden field name

generateFormSubmit

protected java.lang.String generateFormSubmit(javax.faces.context.FacesContext context,
                                              javax.faces.component.UIComponent component,
                                              java.lang.String action)
Generate FORM submit JavaScript for the specified action

Parameters:
context - FacesContext
component - The UIComponent
action - Action string
Returns:
FORM submit JavaScript


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.