org.apache.myfaces.renderkit.html
Class HtmlRendererUtils

java.lang.Object
  |
  +--org.apache.myfaces.renderkit.html.HtmlRendererUtils

public final class HtmlRendererUtils
extends java.lang.Object

Version:
$Revision: 1.30 $ $Date: 2005/03/22 12:25:30 $ $Log: HtmlRendererUtils.java,v $ Revision 1.30 2005/03/22 12:25:30 tomsp fixed bug in renderSelectOptions - looking for itemStrValue in lookupSet did not work Revision 1.29 2005/03/16 20:34:36 mmarinschek fix for MYFACES-89, alien commit for Heath Borders Revision 1.28 2005/03/15 05:24:03 svieujot Add a fallback textarea mode to the htmlEditor. Revision 1.27 2005/01/24 15:43:13 svieujot Adjust comments. Revision 1.20 2004/10/13 11:51:01 matze renamed packages to org.apache Revision 1.19 2004/09/08 09:32:03 manolito MyfacesConfig moved to config package Revision 1.18 2004/08/09 11:47:09 manolito CSS style support also for non OL or UL layout Revision 1.17 2004/07/18 22:45:11 o_rossmueller fix #992668: convert values to string for 'selected' comparision Revision 1.16 2004/07/09 02:26:19 dave0000 cleanup Revision 1.15 2004/07/01 22:00:57 mwessendorf ASF switch Revision 1.14 2004/06/21 23:23:37 o_rossmueller fix #976411: removed tag for selectMultiCheckbox fix #972165: also check for readonly and also check for selectMultiCheckbox Revision 1.13 2004/06/17 00:35:50 o_rossmueller fix #972165: do not reset disabled html checkboxes (the browser does not send a form value for disabled checkboxes even if value=true) Revision 1.12 2004/06/16 23:51:15 o_rossmueller fix #970747: force separate end tag for empty select list Revision 1.11 2004/06/03 12:57:03 o_rossmueller modified link renderer to use one hidden field for all links according to 1.1 renderkit docs added onclick=clear_XXX to button Revision 1.10 2004/05/29 10:19:54 mwessendorf made the class FINAL, because has only one private const Revision 1.9 2004/05/18 14:31:39 manolito user role support completely moved to components source tree Revision 1.8 2004/05/03 11:34:27 manolito bug #945118 (Checkbox session state) fixed Revision 1.7 2004/04/30 09:11:38 manolito no message Revision 1.6 2004/04/29 19:34:38 o_rossmueller javascript for 'target' attribute handling Revision 1.5 2004/04/29 14:25:23 manolito javascript function name bugfix Revision 1.4 2004/04/27 10:32:24 manolito clear hidden inputs javascript function Revision 1.3 2004/04/06 15:34:12 manolito decode methods must not set submitted value to null Revision 1.2 2004/04/01 12:43:18 manolito html nesting bug fixed Revision 1.1 2004/03/29 14:57:00 manolito refactoring for implementation and non-standard component split Revision 1.17 2004/03/26 13:39:14 manolito added javascript 'return false' to onClick attribute in render link method
Author:
Manfred Geiler (latest modification by $Author: tomsp $)

Nested Class Summary
static class HtmlRendererUtils.LinkParameter
           
 
Method Summary
static void decodeUIInput(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
          X-CHECKED: tlddoc h:inputText
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 java.lang.String getClearHiddenCommandFormParamsFunctionName(java.lang.String formName)
          Prefixes the given String with "clear_" and removes special characters
static java.lang.String getFormName(javax.faces.component.UIComponent component, javax.faces.context.FacesContext context)
           
static java.lang.String getHiddenCommandLinkFieldName(java.lang.String formName)
           
static boolean isDisabledOrReadOnly(javax.faces.component.UIComponent component)
           
static void renderClearHiddenCommandFormParamsFunction(javax.faces.context.ResponseWriter writer, java.lang.String formName, java.util.Set dummyFormParams, java.lang.String formTarget)
          Render the javascript function that is called on a click on a commandLink to clear the hidden inputs.
static void renderHiddenCommandFormParams(javax.faces.context.ResponseWriter writer, java.util.Set dummyFormParams)
           
static boolean renderHTMLAttribute(javax.faces.context.ResponseWriter writer, java.lang.String componentProperty, java.lang.String attrName, java.lang.Object value)
           
static boolean renderHTMLAttribute(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String componentProperty, java.lang.String htmlAttrName)
           
static boolean renderHTMLAttributes(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String[] attributes)
           
static boolean renderHTMLAttributesWithOptionalStartElement(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String elementName, java.lang.String[] attributes)
           
static boolean renderHTMLAttributeWithOptionalStartElement(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String elementName, java.lang.String attrName, java.lang.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, java.lang.String elementName, java.lang.String[] attributes)
           
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
 

Method Detail

decodeUIInput

public static void decodeUIInput(javax.faces.context.FacesContext facesContext,
                                 javax.faces.component.UIComponent component)
X-CHECKED: tlddoc h:inputText

Parameters:
facesContext -
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 java.io.IOException
java.io.IOException

renderListbox

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

renderMenu

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

renderMenu

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

writePrettyLineSeparator

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

writePrettyIndent

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

renderHTMLAttribute

public static boolean renderHTMLAttribute(javax.faces.context.ResponseWriter writer,
                                          java.lang.String componentProperty,
                                          java.lang.String attrName,
                                          java.lang.Object value)
                                   throws java.io.IOException
Returns:
true, if the attribute was written
Throws:
java.io.IOException

renderHTMLAttribute

public static boolean renderHTMLAttribute(javax.faces.context.ResponseWriter writer,
                                          javax.faces.component.UIComponent component,
                                          java.lang.String componentProperty,
                                          java.lang.String htmlAttrName)
                                   throws java.io.IOException
Returns:
true, if the attribute was written
Throws:
java.io.IOException

renderHTMLAttributes

public static boolean renderHTMLAttributes(javax.faces.context.ResponseWriter writer,
                                           javax.faces.component.UIComponent component,
                                           java.lang.String[] attributes)
                                    throws java.io.IOException
Returns:
true, if an attribute was written
Throws:
java.io.IOException

renderHTMLAttributeWithOptionalStartElement

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

renderHTMLAttributesWithOptionalStartElement

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

renderOptionalEndElement

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

writeIdIfNecessary

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

renderHiddenCommandFormParams

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

renderClearHiddenCommandFormParamsFunction

public static void renderClearHiddenCommandFormParamsFunction(javax.faces.context.ResponseWriter writer,
                                                              java.lang.String formName,
                                                              java.util.Set dummyFormParams,
                                                              java.lang.String formTarget)
                                                       throws java.io.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 cause the according action once more!

Parameters:
writer -
formName -
dummyFormParams -
formTarget -
Throws:
java.io.IOException

getClearHiddenCommandFormParamsFunctionName

public static java.lang.String getClearHiddenCommandFormParamsFunctionName(java.lang.String formName)
Prefixes the given String with "clear_" and removes special characters

Parameters:
formName -
Returns:

getFormName

public static java.lang.String getFormName(javax.faces.component.UIComponent component,
                                           javax.faces.context.FacesContext context)

getHiddenCommandLinkFieldName

public static java.lang.String getHiddenCommandLinkFieldName(java.lang.String formName)