Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.myfaces.shared_orchestra.renderkit.html
Class HtmlRendererUtils

    java.lang.Object
      org.apache.myfaces.shared_orchestra.renderkit.html.HtmlRendererUtils

    public final class HtmlRendererUtils

extends Object

Version:
  $Revision: 613572 $ $Date: 2008-01-20 10:07:27 -0500 (Sun, 20 Jan 2008) $
Author:
  Manfred Geiler (latest modification by $Author: skitching $)

Nested Class Summary
`static class` | `HtmlRendererUtils.LinkParameter`
`static class` | `HtmlRendererUtils.ScriptContext` The ScriptContext offers methods and fields to help with rendering out a script and keeping a proper formatting.

Field Summary
`static String` | `ALLOW_CDATA_SECTION_ON`
`static String` | `CLEAR_HIDDEN_FIELD_FN_NAME`
`static String` | `DEFAULT_CHAR_ENCODING`
`static String` | `HIDDEN_COMMANDLINK_FIELD_NAME`
`static String` | `HIDDEN_COMMANDLINK_FIELD_NAME_MYFACES_OLD`
`static String` | `HIDDEN_COMMANDLINK_FIELD_NAME_TRINIDAD`
`static String` | `NON_SUBMITTED_VALUE_WARNING`
`static String` | `SUBMIT_FORM_FN_NAME`

Method Summary
`static void` | `allowCdataSection(javax.faces.context.FacesContext fc, boolean cdataSectionAllowed)`
`static void` | `appendAutoScrollAssignment(StringBuffer onClickValue, String formName)` Adds the hidden form input value assignment that is necessary for the autoscroll feature to an html link or button onclick attribute.
`static void` | `appendClearHiddenCommandFormParamsFunctionCall(StringBuffer buf, String formName)`
`static void` | `decodeUIInput(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)` Utility to set the submitted value of the provided component from the data in the current request object.
`static void` | `decodeUISelectBoolean(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)` X-CHECKED: tlddoc h:selectBooleanCheckbox
`static void` | `decodeUISelectMany(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)` X-CHECKED: tlddoc h:selectManyListbox
`static void` | `decodeUISelectOne(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)` X-CHECKED: tlddoc h:selectManyListbox
`static javax.faces.convert.Converter` | `findUIOutputConverterFailSafe(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)`
`static javax.faces.convert.Converter` | `findUISelectManyConverterFailsafe(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)`
`static String` | `getClearHiddenCommandFormParamsFunctionName(String formName)` Prefixes the given String with CLEAR_HIDDEN_FIELD_FN_NAME and removes special characters
`static String` | `getClearHiddenCommandFormParamsFunctionNameMyfacesLegacy(String formName)`
`static String` | `getDisplayValueOnlyStyle(javax.faces.component.UIComponent component)`
`static String` | `getDisplayValueOnlyStyleClass(javax.faces.component.UIComponent component)`
`static String` | `getHiddenCommandLinkFieldName(FormInfo formInfo)` Get the name of the request parameter that holds the id of the link-type component that caused the form to be submitted.
`static String` | `getHiddenCommandLinkFieldNameMyfacesOld(FormInfo formInfo)`
`static String` | `getImageLocation(javax.faces.component.UIComponent component)`
`static String` | `getJavascriptLocation(javax.faces.component.UIComponent component)`
`static String` | `getStyleLocation(javax.faces.component.UIComponent component)`
`static Set` | `getSubmittedOrSelectedValuesAsSet(boolean selectMany, javax.faces.component.UIComponent uiComponent, javax.faces.context.FacesContext facesContext, javax.faces.convert.Converter converter)`
`static String[]` | `getSupportedContentTypes()`
`static boolean` | `isAllowedCdataSection(javax.faces.context.FacesContext fc)`
`static boolean` | `isDisabledOrReadOnly(javax.faces.component.UIComponent component)`
`static boolean` | `isDisplayValueOnly(javax.faces.component.UIComponent component)`
`static boolean` | `isXHTMLContentType(String contentType)`
`static void` | `renderAutoScrollFunction(javax.faces.context.FacesContext facesContext, javax.faces.context.ResponseWriter writer)` Renders the autoscroll javascript function.
`static void` | `renderAutoScrollHiddenInput(javax.faces.context.FacesContext facesContext, javax.faces.context.ResponseWriter writer)` Renders the hidden form input that is necessary for the autoscroll feature.
`static void` | `renderClearHiddenCommandFormParamsFunction(javax.faces.context.ResponseWriter writer, String formName, Set dummyFormParams, String formTarget)` Render the javascript function that is called on a click on a commandLink to clear the hidden inputs.
`static void` | `renderDisplayValueOnly(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent input)`
`static void` | `renderDisplayValueOnlyAttributes(javax.faces.component.UIComponent uiComponent, javax.faces.context.ResponseWriter writer)`
`static void` | `renderDisplayValueOnlyForSelects(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)`
`static void` | `renderFormSubmitScript(javax.faces.context.FacesContext facesContext)`
`static void` | `renderHiddenCommandFormParams(javax.faces.context.ResponseWriter writer, Set dummyFormParams)`
`static void` | `renderHiddenInputField(javax.faces.context.ResponseWriter writer, Object name, Object value)`
`static boolean` | `renderHTMLAttribute(javax.faces.context.ResponseWriter writer, String componentProperty, String attrName, Object value)`
`static boolean` | `renderHTMLAttribute(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, String componentProperty, String htmlAttrName)`
`static boolean` | `renderHTMLAttributes(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, String[] attributes)`
`static boolean` | `renderHTMLAttributesWithOptionalStartElement(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, String elementName, String[] attributes)`
`static boolean` | `renderHTMLAttributeWithOptionalStartElement(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, String elementName, String attrName, Object value, boolean startElementWritten)`
`static void` | `renderListbox(javax.faces.context.FacesContext facesContext, javax.faces.component.UISelectMany selectMany, boolean disabled, int size)`
`static void` | `renderListbox(javax.faces.context.FacesContext facesContext, javax.faces.component.UISelectOne selectOne, boolean disabled, int size)`
`static void` | `renderMenu(javax.faces.context.FacesContext facesContext, javax.faces.component.UISelectMany selectMany, boolean disabled)`
`static void` | `renderMenu(javax.faces.context.FacesContext facesContext, javax.faces.component.UISelectOne selectOne, boolean disabled)`
`static boolean` | `renderOptionalEndElement(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, String elementName, String[] attributes)`
`static void` | `renderSelectOptions(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.convert.Converter converter, Set lookupSet, List selectItemList)` Renders the select options for a `UIComponent` that is rendered as an HTML select element.
`static String` | `selectContentType(String contentTypeListString)`
`static void` | `writeIdIfNecessary(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, javax.faces.context.FacesContext facesContext)`
`static void` | `writePrettyIndent(javax.faces.context.FacesContext facesContext)`
`static void` | `writePrettyLineSeparator(javax.faces.context.FacesContext facesContext)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### HIDDEN_COMMANDLINK_FIELD_NAME

    public static final String HIDDEN_COMMANDLINK_FIELD_NAME

See Also:
  Constant Field Values

### HIDDEN_COMMANDLINK_FIELD_NAME_MYFACES_OLD

    public static final String HIDDEN_COMMANDLINK_FIELD_NAME_MYFACES_OLD

See Also:
  Constant Field Values

### HIDDEN_COMMANDLINK_FIELD_NAME_TRINIDAD

    public static final String HIDDEN_COMMANDLINK_FIELD_NAME_TRINIDAD

See Also:
  Constant Field Values

### CLEAR_HIDDEN_FIELD_FN_NAME

    public static final String CLEAR_HIDDEN_FIELD_FN_NAME

See Also:
  Constant Field Values

### SUBMIT_FORM_FN_NAME

    public static final String SUBMIT_FORM_FN_NAME

See Also:
  Constant Field Values

### ALLOW_CDATA_SECTION_ON

    public static final String ALLOW_CDATA_SECTION_ON

See Also:
  Constant Field Values

### NON_SUBMITTED_VALUE_WARNING

    public static final String NON_SUBMITTED_VALUE_WARNING

See Also:
  Constant Field Values

### DEFAULT_CHAR_ENCODING

    public static String DEFAULT_CHAR_ENCODING

Method Detail

### decodeUIInput

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

  Utility to set the submitted value of the provided component from the data in the current request object.

  Param component is required to be an EditableValueHolder. On return from this method, the component's submittedValue property will be set if the submitted form contained that component.

### decodeUISelectBoolean

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

  X-CHECKED: tlddoc h:selectBooleanCheckbox

  Parameters:
    `facesContext` -
    `component` -

### isDisabledOrReadOnly

    public static boolean isDisabledOrReadOnly(javax.faces.component.UIComponent component)

### decodeUISelectMany

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

  X-CHECKED: tlddoc h:selectManyListbox

  Parameters:
    `facesContext` -
    `component` -

### decodeUISelectOne

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

  X-CHECKED: tlddoc h:selectManyListbox

  Parameters:
    `facesContext` -
    `component` -

### renderListbox

    public static void renderListbox(javax.faces.context.FacesContext facesContext,
                                     javax.faces.component.UISelectOne selectOne,
                                     boolean disabled,
                                     int size)
                              throws IOException

  Throws:
    `IOException`

### renderListbox

    public static void renderListbox(javax.faces.context.FacesContext facesContext,
                                     javax.faces.component.UISelectMany selectMany,
                                     boolean disabled,
                                     int size)
                              throws IOException

  Throws:
    `IOException`

### renderMenu

    public static void renderMenu(javax.faces.context.FacesContext facesContext,
                                  javax.faces.component.UISelectOne selectOne,
                                  boolean disabled)
                           throws IOException

  Throws:
    `IOException`

### renderMenu

    public static void renderMenu(javax.faces.context.FacesContext facesContext,
                                  javax.faces.component.UISelectMany selectMany,
                                  boolean disabled)
                           throws IOException

  Throws:
    `IOException`

### getSubmittedOrSelectedValuesAsSet

    public static Set getSubmittedOrSelectedValuesAsSet(boolean selectMany,
                                                        javax.faces.component.UIComponent uiComponent,
                                                        javax.faces.context.FacesContext facesContext,
                                                        javax.faces.convert.Converter converter)

### findUISelectManyConverterFailsafe

    public static javax.faces.convert.Converter findUISelectManyConverterFailsafe(javax.faces.context.FacesContext facesContext,
                                                                                  javax.faces.component.UIComponent uiComponent)

### findUIOutputConverterFailSafe

    public static javax.faces.convert.Converter findUIOutputConverterFailSafe(javax.faces.context.FacesContext facesContext,
                                                                              javax.faces.component.UIComponent uiComponent)

### renderSelectOptions

    public static void renderSelectOptions(javax.faces.context.FacesContext context,
                                           javax.faces.component.UIComponent component,
                                           javax.faces.convert.Converter converter,
                                           Set lookupSet,
                                           List selectItemList)
                                    throws IOException

  Renders the select options for a `UIComponent` that is rendered as an HTML select element.

  Parameters:
    `context` - the current `FacesContext`.
    `component` - the `UIComponent` whose options need to be rendered.
    `converter` - `component`'s converter
    `lookupSet` - the `Set` to use to look up selected options
    `selectItemList` - the `List` of `SelectItem` s to be rendered as HTML option elements.
  Throws:
    `IOException`

### writePrettyLineSeparator

    public static void writePrettyLineSeparator(javax.faces.context.FacesContext facesContext)
                                         throws IOException

  Throws:
    `IOException`

### writePrettyIndent

    public static void writePrettyIndent(javax.faces.context.FacesContext facesContext)
                                  throws IOException

  Throws:
    `IOException`

### renderHTMLAttribute

    public static boolean renderHTMLAttribute(javax.faces.context.ResponseWriter writer,
                                              String componentProperty,
                                              String attrName,
                                              Object value)
                                       throws IOException

  Returns:
    true, if the attribute was written
  Throws:
    `IOException`

### renderHTMLAttribute

    public static boolean renderHTMLAttribute(javax.faces.context.ResponseWriter writer,
                                              javax.faces.component.UIComponent component,
                                              String componentProperty,
                                              String htmlAttrName)
                                       throws IOException

  Returns:
    true, if the attribute was written
  Throws:
    `IOException`

### renderHTMLAttributes

    public static boolean renderHTMLAttributes(javax.faces.context.ResponseWriter writer,
                                               javax.faces.component.UIComponent component,
                                               String[] attributes)
                                        throws IOException

  Returns:
    true, if an attribute was written
  Throws:
    `IOException`

### renderHTMLAttributeWithOptionalStartElement

    public static boolean renderHTMLAttributeWithOptionalStartElement(javax.faces.context.ResponseWriter writer,
                                                                      javax.faces.component.UIComponent component,
                                                                      String elementName,
                                                                      String attrName,
                                                                      Object value,
                                                                      boolean startElementWritten)
                                                               throws IOException

  Throws:
    `IOException`

### renderHTMLAttributesWithOptionalStartElement

    public static boolean renderHTMLAttributesWithOptionalStartElement(javax.faces.context.ResponseWriter writer,
                                                                       javax.faces.component.UIComponent component,
                                                                       String elementName,
                                                                       String[] attributes)
                                                                throws IOException

  Throws:
    `IOException`

### renderOptionalEndElement

    public static boolean renderOptionalEndElement(javax.faces.context.ResponseWriter writer,
                                                   javax.faces.component.UIComponent component,
                                                   String elementName,
                                                   String[] attributes)
                                            throws IOException

  Throws:
    `IOException`

### writeIdIfNecessary

    public static void writeIdIfNecessary(javax.faces.context.ResponseWriter writer,
                                          javax.faces.component.UIComponent component,
                                          javax.faces.context.FacesContext facesContext)
                                   throws IOException

  Throws:
    `IOException`

### renderDisplayValueOnlyForSelects

    public static void renderDisplayValueOnlyForSelects(javax.faces.context.FacesContext facesContext,
                                                        javax.faces.component.UIComponent uiComponent)
                                                 throws IOException

  Throws:
    `IOException`

### renderDisplayValueOnlyAttributes

    public static void renderDisplayValueOnlyAttributes(javax.faces.component.UIComponent uiComponent,
                                                        javax.faces.context.ResponseWriter writer)
                                                 throws IOException

  Throws:
    `IOException`

### getDisplayValueOnlyStyleClass

    public static String getDisplayValueOnlyStyleClass(javax.faces.component.UIComponent component)

### getDisplayValueOnlyStyle

    public static String getDisplayValueOnlyStyle(javax.faces.component.UIComponent component)

### isDisplayValueOnly

    public static boolean isDisplayValueOnly(javax.faces.component.UIComponent component)

### renderDisplayValueOnly

    public static void renderDisplayValueOnly(javax.faces.context.FacesContext facesContext,
                                              javax.faces.component.UIComponent input)
                                       throws IOException

  Throws:
    `IOException`

### appendClearHiddenCommandFormParamsFunctionCall

    public static void appendClearHiddenCommandFormParamsFunctionCall(StringBuffer buf,
                                                                      String formName)

### renderFormSubmitScript

    public static void renderFormSubmitScript(javax.faces.context.FacesContext facesContext)
                                       throws IOException

  Throws:
    `IOException`

### appendAutoScrollAssignment

    public static void appendAutoScrollAssignment(StringBuffer onClickValue,
                                                  String formName)

  Adds the hidden form input value assignment that is necessary for the autoscroll feature to an html link or button onclick attribute.

### renderAutoScrollHiddenInput

    public static void renderAutoScrollHiddenInput(javax.faces.context.FacesContext facesContext,
                                                   javax.faces.context.ResponseWriter writer)
                                            throws IOException

  Renders the hidden form input that is necessary for the autoscroll feature.

  Throws:
    `IOException`

### renderAutoScrollFunction

    public static void renderAutoScrollFunction(javax.faces.context.FacesContext facesContext,
                                                javax.faces.context.ResponseWriter writer)
                                         throws IOException

  Renders the autoscroll javascript function.

  Throws:
    `IOException`

### isAllowedCdataSection

    public static boolean isAllowedCdataSection(javax.faces.context.FacesContext fc)

### allowCdataSection

    public static void allowCdataSection(javax.faces.context.FacesContext fc,
                                         boolean cdataSectionAllowed)

### renderHiddenCommandFormParams

    public static void renderHiddenCommandFormParams(javax.faces.context.ResponseWriter writer,
                                                     Set dummyFormParams)
                                              throws IOException

  Throws:
    `IOException`

### renderHiddenInputField

    public static void renderHiddenInputField(javax.faces.context.ResponseWriter writer,
                                              Object name,
                                              Object value)
                                       throws IOException

  Throws:
    `IOException`

### renderClearHiddenCommandFormParamsFunction

    public static void renderClearHiddenCommandFormParamsFunction(javax.faces.context.ResponseWriter writer,
                                                                  String formName,
                                                                  Set dummyFormParams,
                                                                  String formTarget)
                                                           throws IOException

  Render the javascript function that is called on a click on a commandLink to clear the hidden inputs. This is necessary because on a browser back, each hidden input still has it's old value (browser cache!) and therefore a new submit would fire the according action once more!

  Parameters:
    `writer` -
    `formName` -
    `dummyFormParams` -
    `formTarget` -
  Throws:
    `IOException`

### getClearHiddenCommandFormParamsFunctionName

    public static String getClearHiddenCommandFormParamsFunctionName(String formName)

  Prefixes the given String with CLEAR_HIDDEN_FIELD_FN_NAME and removes special characters

  Parameters:
    `formName` -
  Returns:
    String

### getClearHiddenCommandFormParamsFunctionNameMyfacesLegacy

    public static String getClearHiddenCommandFormParamsFunctionNameMyfacesLegacy(String formName)

### getHiddenCommandLinkFieldName

    public static String getHiddenCommandLinkFieldName(FormInfo formInfo)

  Get the name of the request parameter that holds the id of the link-type component that caused the form to be submitted.

  Within each page there may be multiple "link" type components that cause page submission. On the server it is necessary to know which of these actually caused the submit, in order to invoke the correct listeners. Such components therefore store their id into the "hidden command link field" in their associated form before submitting it.

  The field is always a direct child of each form, and has the same name in each form. The id of the form component is therefore both necessary and sufficient to determine the full name of the field.

### getHiddenCommandLinkFieldNameMyfacesOld

    public static String getHiddenCommandLinkFieldNameMyfacesOld(FormInfo formInfo)

### selectContentType

    public static String selectContentType(String contentTypeListString)

### getSupportedContentTypes

    public static String[] getSupportedContentTypes()

### isXHTMLContentType

    public static boolean isXHTMLContentType(String contentType)

### getJavascriptLocation

    public static String getJavascriptLocation(javax.faces.component.UIComponent component)

### getImageLocation

    public static String getImageLocation(javax.faces.component.UIComponent component)

### getStyleLocation

    public static String getStyleLocation(javax.faces.component.UIComponent component)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012 The Apache Software Foundation. All Rights Reserved.