org.richfaces.ui.input.autocomplete

## Class AutocompleteRendererBase

- java.lang.Object
- - javax.faces.render.Renderer
  - - org.richfaces.renderkit.RendererBase
    - - org.richfaces.ui.input.InputRendererBase
      - - org.richfaces.ui.input.autocomplete.AutocompleteRendererBase

- All Implemented Interfaces:
    MetaComponentRenderer
  Direct Known Subclasses:
    AutocompleteRenderer

      public abstract class AutocompleteRendererBase
      extends InputRendererBase
      implements MetaComponentRenderer

  Renderer for Autocomplete which handles rendering of suggestions as meta component.
  Author:
    Lukas Fryc, Nick Belaevski

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `RENDERER_TYPE`

    - ### Fields inherited from class javax.faces.render.Renderer

      `PASSTHROUGH_RENDERER_LOCALNAME_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AutocompleteRendererBase()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.faces.model.DataModel` | `asDataModel(Object suggestions)` Wraps the object representing suggestions to the `DataModel` instance so that we can be easily iterated over.
    `void` | `decodeMetaComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String metaComponentId)` Decoding of meta component isn't supported by this renderer
    `protected void` | `doDecode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)` Template method for custom decoding of concrete renderer.
    `protected void` | `doEncodeBegin(javax.faces.context.ResponseWriter writer, javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)` Do not render content
    `void` | `encodeMetaComponent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String metaComponentId)` Encodes meta components supported by this renderer: @suggestions
    `JSReference` | `getClientFilterFunction(javax.faces.component.UIComponent component)` Returns the @clientFilterFunction as reference to the function so that it can be easily converted for registration in component bridge.
    `Object` | `getConvertedValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object val)`
    `boolean` | `getRendersChildren()`
    `protected Object` | `getSuggestions(javax.faces.context.FacesContext facesContext, AbstractAutocomplete component)` Returns the object representing suggestions as returned by application logic.
    `protected javax.faces.model.DataModel<Object>` | `getSuggestionsAsDataModel(javax.faces.context.FacesContext facesContext, AbstractAutocomplete component)` Returns suggestions as DataModel ready for iteration
    `abstract void` | `renderSuggestions(javax.faces.context.ResponseWriter responseWriter, javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)` The implementation of rendering suggestions must be provided so that it can be used by both on initial request as well as during AJAX updates of suggestions.
    `protected Object` | `saveVar(javax.faces.context.FacesContext context, String var)`
    `protected void` | `setVar(javax.faces.context.FacesContext context, String var, Object varObject)`

    - ### Methods inherited from class org.richfaces.ui.input.InputRendererBase

      `getInputValue`

    - ### Methods inherited from class org.richfaces.renderkit.RendererBase

      `concatClasses, concatStyles, decode, doEncodeChildren, doEncodeEnd, encodeBegin, encodeChildren, encodeEnd, getComponentClass, getResourcePath, getSkin, getUtils, preDecode, preEncodeBegin, queueComponentEventForBehaviorEvent, renderChildren`

    - ### Methods inherited from class javax.faces.render.Renderer

      `convertClientId`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### RENDERER_TYPE

          public static final String RENDERER_TYPE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AutocompleteRendererBase

          public AutocompleteRendererBase()

  - ### Method Detail

    - #### doEncodeBegin

          protected void doEncodeBegin(javax.faces.context.ResponseWriter writer,
                           javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
                                throws IOException

      Do not render content
      Overrides:
        `doEncodeBegin` in class `RendererBase`
      Throws:
        `IOException`

    - #### getRendersChildren

          public boolean getRendersChildren()

      Overrides:
        `getRendersChildren` in class `javax.faces.render.Renderer`

    - #### saveVar

          protected Object saveVar(javax.faces.context.FacesContext context,
                       String var)

    - #### setVar

          protected void setVar(javax.faces.context.FacesContext context,
                    String var,
                    Object varObject)

    - #### doDecode

          protected void doDecode(javax.faces.context.FacesContext context,
                      javax.faces.component.UIComponent component)

      Description copied from class: `RendererBase`
      Template method for custom decoding of concrete renderer. All parameters checking if performed in original `decode` method.
      Overrides:
        `doDecode` in class `InputRendererBase`

    - #### getSuggestionsAsDataModel

          protected javax.faces.model.DataModel<Object> getSuggestionsAsDataModel(javax.faces.context.FacesContext facesContext,
                                                                      AbstractAutocomplete component)

      Returns suggestions as DataModel ready for iteration

    - #### encodeMetaComponent

          public void encodeMetaComponent(javax.faces.context.FacesContext context,
                                 javax.faces.component.UIComponent component,
                                 String metaComponentId)
                                   throws IOException

      Encodes meta components supported by this renderer:
      - @suggestions
      Specified by:
        `encodeMetaComponent` in interface `MetaComponentRenderer`
      Throws:
        `IOException`

    - #### renderSuggestions

          public abstract void renderSuggestions(javax.faces.context.ResponseWriter responseWriter,
                               javax.faces.context.FacesContext facesContext,
                               javax.faces.component.UIComponent uiComponent)
                                          throws IOException

      The implementation of rendering suggestions must be provided so that it can be used by both on initial request as well as during AJAX updates of suggestions.
      Throws:
        `IOException`

    - #### decodeMetaComponent

          public void decodeMetaComponent(javax.faces.context.FacesContext context,
                                 javax.faces.component.UIComponent component,
                                 String metaComponentId)

      Decoding of meta component isn't supported by this renderer
      Specified by:
        `decodeMetaComponent` in interface `MetaComponentRenderer`

    - #### getSuggestions

          protected Object getSuggestions(javax.faces.context.FacesContext facesContext,
                              AbstractAutocomplete component)

      Returns the object representing suggestions as returned by application logic. It needs to be further converted in `getSuggestionsAsDataModel(FacesContext, AbstractAutocomplete)` method.

    - #### asDataModel

          public javax.faces.model.DataModel asDataModel(Object suggestions)

      Wraps the object representing suggestions to the `DataModel` instance so that we can be easily iterated over.

    - #### getConvertedValue

          public Object getConvertedValue(javax.faces.context.FacesContext context,
                                 javax.faces.component.UIComponent component,
                                 Object val)
                                   throws javax.faces.convert.ConverterException

      Overrides:
        `getConvertedValue` in class `InputRendererBase`
      Throws:
        `javax.faces.convert.ConverterException`

    - #### getClientFilterFunction

          public JSReference getClientFilterFunction(javax.faces.component.UIComponent component)

      Returns the @clientFilterFunction as reference to the function so that it can be easily converted for registration in component bridge.

Copyright © 2014 JBoss by Red Hat. All rights reserved.