org.apache.myfaces.renderkit.html.util
Class JavascriptUtils

java.lang.Object
  extended byorg.apache.myfaces.renderkit.html.util.JavascriptUtils

public final class JavascriptUtils
extends java.lang.Object

Version:
$Revision: 1.12 $ $Date: 2004/12/27 04:11:11 $ $Log: JavascriptUtils.java,v $ Revision 1.12 2004/12/27 04:11:11 mmarinschek Data Table stores the state of facets of children; script tag is rendered with type attribute instead of language attribute, popup works better as a column in a data table Revision 1.11 2004/12/23 09:15:15 mmarinschek changes to utils to handle ie better Revision 1.10 2004/12/02 21:31:56 svieujot Bugfix in encodeString Revision 1.9 2004/10/13 11:51:01 matze renamed packages to org.apache Revision 1.8 2004/09/10 14:13:52 manolito trivial change Revision 1.7 2004/09/08 15:51:15 manolito Autoscroll now also for horizontal scrolling Revision 1.6 2004/09/08 15:23:11 manolito Autoscroll feature Revision 1.5 2004/09/08 09:31:25 manolito moved isJavascriptDetected from MyFacesConfig to JavascriptUtils class Revision 1.4 2004/07/16 13:06:30 manolito encode javascript strings for jscook menu labels Revision 1.3 2004/07/09 02:44:55 dave0000 More efficient implementation Revision 1.2 2004/07/01 22:00:53 mwessendorf ASF switch Revision 1.1 2004/04/29 14:25:22 manolito javascript function name bugfix
Author:
Manfred Geiler (latest modification by $Author: mmarinschek $), Anton Koinov

Field Summary
static java.lang.String JAVASCRIPT_DETECTED
           
 
Method Summary
static void appendAutoScrollAssignment(java.lang.StringBuffer onClickValue, java.lang.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 java.lang.String encodeString(java.lang.String string)
           
static java.lang.String getOldViewId(javax.faces.context.ExternalContext externalContext)
           
static java.lang.String getValidJavascriptName(java.lang.String s, boolean checkForReservedWord)
           
static boolean isJavascriptAllowed(javax.faces.context.ExternalContext externalContext)
           
static boolean isJavascriptDetected(javax.faces.context.ExternalContext externalContext)
           
static void renderAutoScrollFunction(javax.faces.context.FacesContext facesContext, javax.faces.context.ResponseWriter writer)
          Renders the autoscroll javascript function.
static void renderAutoScrollHiddenInput(javax.faces.context.ResponseWriter writer)
          Renders the hidden form input that is necessary for the autoscroll feature.
static void setJavascriptDetected(javax.faces.context.ExternalContext externalContext, boolean value)
           
static void setOldViewId(javax.faces.context.ExternalContext externalContext, java.lang.String viewId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVASCRIPT_DETECTED

public static final java.lang.String JAVASCRIPT_DETECTED
Method Detail

getValidJavascriptName

public static java.lang.String getValidJavascriptName(java.lang.String s,
                                                      boolean checkForReservedWord)

encodeString

public static java.lang.String encodeString(java.lang.String string)

isJavascriptAllowed

public static boolean isJavascriptAllowed(javax.faces.context.ExternalContext externalContext)

setJavascriptDetected

public static void setJavascriptDetected(javax.faces.context.ExternalContext externalContext,
                                         boolean value)

isJavascriptDetected

public static boolean isJavascriptDetected(javax.faces.context.ExternalContext externalContext)

appendAutoScrollAssignment

public static void appendAutoScrollAssignment(java.lang.StringBuffer onClickValue,
                                              java.lang.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.ResponseWriter writer)
                                        throws java.io.IOException
Renders the hidden form input that is necessary for the autoscroll feature.

Throws:
java.io.IOException

renderAutoScrollFunction

public static void renderAutoScrollFunction(javax.faces.context.FacesContext facesContext,
                                            javax.faces.context.ResponseWriter writer)
                                     throws java.io.IOException
Renders the autoscroll javascript function.

Throws:
java.io.IOException

setOldViewId

public static void setOldViewId(javax.faces.context.ExternalContext externalContext,
                                java.lang.String viewId)

getOldViewId

public static java.lang.String getOldViewId(javax.faces.context.ExternalContext externalContext)