| java.lang.Object com.icesoft.faces.context.effects.JavascriptContext
JavascriptContext | public class JavascriptContext (Code) | | Used to send Javascript to the browser
|
Method Summary | |
public static void | addJavascriptCall(FacesContext facesContext, String call) Add a javascript call to be executed on the browser. | public static void | applicationFocus(FacesContext facesContext, String id) Set the application focus for the current request, overrides and setFocus call.
Generally setFocus is used by components, while setApplicationFocus is used by the application. | public static String | applyEffect(Effect effect, String id, FacesContext context) Wrap the effect in a javascript method to be called later. | public static void | fireEffect(Effect effect, String id, FacesContext context) Fire an effect at the end of the current render cycle. | public static void | fireEffect(Effect effect, UIComponent component) | public static void | fireEffect(Effect effect, UIComponent component, FacesContext facesContext) | public static void | fireEffect(UIComponent uiComponent, FacesContext facesContext) | public static void | focus(FacesContext context, String id) \ Set focus on an HTML element. | public static String | getEffectFunctionForEvent(UIComponent uiComponent, String event, String id, FacesContext facesContext) | public static String | getFocus(FacesContext context) | public static String[] | getIncludedLibs(FacesContext facesContext) | public static String | getJavascriptCalls(FacesContext facesContext) | public static String | getJavascriptCalls(Map map) | public static void | includeLib(String libname, FacesContext facesContext) Include a script tag in the <head> section of the page with the src
attribute set to libname. |
DYNAMIC_CODE_ID | final public static String DYNAMIC_CODE_ID(Code) | | ID of script node used to send Javascript in a dom update
|
ICE_BRIDGE | final public static String ICE_BRIDGE(Code) | | URL of the ICE Bridge lib
|
ICE_EXTRAS | final public static String ICE_EXTRAS(Code) | | URL of the ICE Extras lib
|
LIB_KEY | final public static String LIB_KEY(Code) | | Request Scope Key, indicating that extras needs to be included
|
addJavascriptCall | public static void addJavascriptCall(FacesContext facesContext, String call)(Code) | | Add a javascript call to be executed on the browser. Code will be
executed at the end of the current render cycle.
Note: When sending function definitions you must specify the function
name as this['functionName'] = function(){} For example:
helloWorld(name}{ alert('Hello [' + name + ']'); }
Would need to be written as this['helloWorld'] = function(name){
alert('Hello [' + name + ']'); }
Parameters: facesContext - Parameters: call - Javascript code to execute |
applicationFocus | public static void applicationFocus(FacesContext facesContext, String id)(Code) | | Set the application focus for the current request, overrides and setFocus call.
Generally setFocus is used by components, while setApplicationFocus is used by the application.
Parameters: id - |
applyEffect | public static String applyEffect(Effect effect, String id, FacesContext context)(Code) | | Wrap the effect in a javascript method to be called later. Returns the
method name. Used in local effects.
Parameters: effect - Parameters: id - Parameters: context - The name of the method that wraps the effect |
fireEffect | public static void fireEffect(Effect effect, String id, FacesContext context)(Code) | | Fire an effect at the end of the current render cycle. Fired from server, non local.
Parameters: effect - Parameters: id - Target element of the effect Parameters: context - |
fireEffect | public static void fireEffect(Effect effect, UIComponent component)(Code) | | Fire an effect at the end of the current render cycle
Parameters: effect - Parameters: component - |
fireEffect | public static void fireEffect(Effect effect, UIComponent component, FacesContext facesContext)(Code) | | Fire an effect at the end of the current render cycle
Parameters: effect - Parameters: component - Parameters: facesContext - |
fireEffect | public static void fireEffect(UIComponent uiComponent, FacesContext facesContext)(Code) | | Fire an effect at the end of the current render cycle
Parameters: uiComponent - Parameters: facesContext - |
focus | public static void focus(FacesContext context, String id)(Code) | | \ Set focus on an HTML element.
Parameters: context - Parameters: id - |
getEffectFunctionForEvent | public static String getEffectFunctionForEvent(UIComponent uiComponent, String event, String id, FacesContext facesContext)(Code) | | Get the Effect function for a given event
Parameters: uiComponent - Parameters: event - Parameters: id - Parameters: facesContext - |
getFocus | public static String getFocus(FacesContext context)(Code) | | Get the focus for the current request
Parameters: context - |
getIncludedLibs | public static String[] getIncludedLibs(FacesContext facesContext)(Code) | | Get the included javascript libraries
Parameters: facesContext - |
getJavascriptCalls | public static String getJavascriptCalls(FacesContext facesContext)(Code) | | Add a javascript call to this request
Parameters: facesContext - |
getJavascriptCalls | public static String getJavascriptCalls(Map map)(Code) | | Get javascript calls from the Request map
Parameters: map - |
includeLib | public static void includeLib(String libname, FacesContext facesContext)(Code) | | Include a script tag in the <head> section of the page with the src
attribute set to libname. This will insure that all icefaces pages
contain this script for the remainder of the session.
Parameters: libname - the source of the javascript file Parameters: facesContext - The facescontext this file is needed for |
|
|