org.apache.myfaces.renderkit.html.util

Class JavascriptUtils


public final class JavascriptUtils
extends java.lang.Object

Version:
$Revision: 169655 $ $Date: 2005-05-11 18:45:06 +0200 (Wed, 11 May 2005) $
Authors:
Manfred Geiler (latest modification by $Author: grantsmith $)
Anton Koinov

Field Summary

static String
JAVASCRIPT_DETECTED

Method Summary

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 String
encodeString(String string)
static String
getOldViewId(ExternalContext externalContext)
static String
getValidJavascriptName(String s, boolean checkForReservedWord)
static boolean
isJavascriptAllowed(ExternalContext externalContext)
static boolean
isJavascriptDetected(ExternalContext externalContext)
static void
renderAutoScrollFunction(FacesContext facesContext, ResponseWriter writer)
Renders the autoscroll javascript function.
static void
renderAutoScrollHiddenInput(ResponseWriter writer)
Renders the hidden form input that is necessary for the autoscroll feature.
static void
setJavascriptDetected(ExternalContext externalContext, boolean value)
static void
setOldViewId(ExternalContext externalContext, String viewId)

Field Details

JAVASCRIPT_DETECTED

public static final String JAVASCRIPT_DETECTED

Method Details

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.

encodeString

public static String encodeString(String string)

getOldViewId

public static String getOldViewId(ExternalContext externalContext)

getValidJavascriptName

public static String getValidJavascriptName(String s,
                                            boolean checkForReservedWord)

isJavascriptAllowed

public static boolean isJavascriptAllowed(ExternalContext externalContext)

isJavascriptDetected

public static boolean isJavascriptDetected(ExternalContext externalContext)

renderAutoScrollFunction

public static void renderAutoScrollFunction(FacesContext facesContext,
                                            ResponseWriter writer)
            throws IOException
Renders the autoscroll javascript function.

renderAutoScrollHiddenInput

public static void renderAutoScrollHiddenInput(ResponseWriter writer)
            throws IOException
Renders the hidden form input that is necessary for the autoscroll feature.

setJavascriptDetected

public static void setJavascriptDetected(ExternalContext externalContext,
                                         boolean value)

setOldViewId

public static void setOldViewId(ExternalContext externalContext,
                                String viewId)