public interface JavaScriptSupport
Environmental annotation on a
 component field. In addition, JavaScriptSupport may also be accessed as a service (the service
 internally delegates to the current environmental instance), which is useful
 for service-layer objects.
 The term "import" is used on many methods to indicate that the indicated resource (stack, library or stylesheet) will
 only be added to the final cocument once, even when there are repeated calls.
 The name is slightly a misnomer, since there's a side-line of importStylesheet(StylesheetLink) as well.
 JavaScriptSupport works equally well inside an Ajax request that produces a JSON-formatted partial page update response.DocumentLinker| Modifier and Type | Method and Description | 
|---|---|
| void | addInitializerCall(InitializationPriority priority,
                  java.lang.String functionName,
                  JSONArray parameter)Deprecated. 
 Deprecated in 5.4; refactor to use JavaScript modules instead | 
| void | addInitializerCall(InitializationPriority priority,
                  java.lang.String functionName,
                  JSONObject parameter)Deprecated. 
 Deprecated in 5.4; refactor to use JavaScript modules instead | 
| void | addInitializerCall(InitializationPriority priority,
                  java.lang.String functionName,
                  java.lang.String parameter)Deprecated. 
 Deprecated in 5.4; refactor to use JavaScript modules instead | 
| void | addInitializerCall(java.lang.String functionName,
                  JSONArray parameter)Deprecated. 
 Deprecated in 5.4; refactor to use JavaScript modules instead | 
| void | addInitializerCall(java.lang.String functionName,
                  JSONObject parameter)Deprecated. 
 Deprecated in 5.4; refactor to use JavaScript modules instead | 
| void | addInitializerCall(java.lang.String functionName,
                  java.lang.String parameter)Deprecated. 
 Deprecated in 5.4; refactor to use JavaScript modules instead | 
| void | addModuleConfigurationCallback(ModuleConfigurationCallback callback)Adds a module configuration callback for this request. | 
| void | addScript(InitializationPriority priority,
         java.lang.String format,
         java.lang.Object... arguments)Deprecated. 
 Deprecated in 5.4; refactor to use JavaScript modules instead | 
| void | addScript(java.lang.String format,
         java.lang.Object... arguments)Deprecated. 
 Deprecated in 5.4; refactor to use JavaScript modules instead | 
| java.lang.String | allocateClientId(ComponentResources resources)As with  allocateClientId(String)but uses the id of the component extracted from the resources. | 
| java.lang.String | allocateClientId(java.lang.String id)Allocates a unique id based on the component's id. | 
| JavaScriptSupport | autofocus(FieldFocusPriority priority,
         java.lang.String fieldId)Invoked to set focus on a rendered field. | 
| JavaScriptSupport | importJavaScriptLibrary(Asset asset)Imports a JavaScript library as part of the rendered page. | 
| JavaScriptSupport | importJavaScriptLibrary(java.lang.String libraryURL)Import a Javascript library with an arbitrary URL. | 
| JavaScriptSupport | importStack(java.lang.String stackName)Imports a  JavaScriptStackby name, a related set of JavaScript libraries and stylesheets. | 
| JavaScriptSupport | importStylesheet(Asset stylesheet)A convenience method that wraps the Asset as a  StylesheetLink. | 
| JavaScriptSupport | importStylesheet(StylesheetLink stylesheetLink)Imports a Cascading Style Sheet file as part of the rendered page. | 
| Initialization | require(java.lang.String moduleName)Requires a JavaScript module by name. | 
java.lang.String allocateClientId(java.lang.String id)
id - the component id from which a unique id will be generatedIdAllocatorjava.lang.String allocateClientId(ComponentResources resources)
allocateClientId(String) but uses the id of the component extracted from the resources.resources - of the component which requires an idvoid addScript(java.lang.String format, java.lang.Object... arguments)
InitializationPriority.NORMAL priority.format - format string (as per String.format(String, Object...)arguments - arguments referenced by format specifiersvoid addScript(InitializationPriority priority, java.lang.String format, java.lang.Object... arguments)
priority - priority to use when adding the scriptformat - format string (as per String.format(String, Object...)arguments - arguments referenced by format specifiersvoid addInitializerCall(java.lang.String functionName, JSONObject parameter)
InitializationPriority.NORMAL priority.functionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - object to pass to the client-side functionvoid addInitializerCall(java.lang.String functionName, JSONArray parameter)
InitializationPriority.NORMAL priority.functionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - array of parameters to pass to the client-side functionvoid addInitializerCall(InitializationPriority priority, java.lang.String functionName, JSONArray parameter)
InitializationPriority.NORMAL priority.functionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - array of parameters to pass to the client-side functionvoid addInitializerCall(InitializationPriority priority, java.lang.String functionName, JSONObject parameter)
priority - priority to use when adding the scriptfunctionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - object to pass to the client-side functionvoid addInitializerCall(java.lang.String functionName, java.lang.String parameter)
InitializationPriority.NORMAL priority.functionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - string to pass to function (typically, a client id)void addInitializerCall(InitializationPriority priority, java.lang.String functionName, java.lang.String parameter)
priority - priority to use when adding the scriptfunctionName - name of client-side function (within Tapestry.Initializer namespace) to executeparameter - string to pass to function (typically, a client id)JavaScriptSupport importJavaScriptLibrary(Asset asset)
ImportJavaScriptSupport importStylesheet(Asset stylesheet)
StylesheetLink.stylesheet - asset for the stylesheetimportStylesheet(StylesheetLink)JavaScriptSupport importStylesheet(StylesheetLink stylesheetLink)
stylesheetLink - encapsulates the link URL plus any additional optionsJavaScriptSupport importStack(java.lang.String stackName)
JavaScriptStack by name, a related set of JavaScript libraries and stylesheets.
 Stacks are contributions to the JavaScriptStackSource service. When
 JavaScript aggregation in enabled, the stack will be represented by
 a single virtual URL; otherwise the individual asset URLs of the stack
 will be added to the document.
 Please refer to the notes about libraries vs. modules.stackName - the name of the stack (case is ignored); the stack must existJavaScriptSupport importJavaScriptLibrary(java.lang.String libraryURL)
JavaScriptSupport autofocus(FieldFocusPriority priority, java.lang.String fieldId)
FieldFocusPriority.OVERRIDE can be used to force a particular field to receive
 focus.priority - focus is set only if the provided priority is greater than the current priorityfieldId - id of client-side element to take focusInitialization require(java.lang.String moduleName)
require() the module and
 (optionally) de-reference a function exported by the module (or, treat the module as exporting a single
 implicit function). The function will be invoked. Use the returned Initialization to specify the function name
 to invoke, and the parameters to pass to the function.
 In some cases, a module exports no functions, but performs some initialization (typically, adding document-level
 event handlers), in which case a call to require() is sufficient. In cases where the module, or a function
 within the module, are invoked with no parameters, the calls will be collapsed into a single invocation.
 If the module is part of a JavaScript stack,
 then the stack will be imported; this is important when JavaScript aggregation is enabled,
 but also ensures that libraries in the stack are loaded before the module (for cases where the
 module has dependencies on libraries not wrapped as AMD modules).moduleName - the name of the module to requirevoid addModuleConfigurationCallback(ModuleConfigurationCallback callback)
callback - a ModuleConfigurationCallback. It cannot be null.DocumentLinker.addModuleConfigurationCallback(ModuleConfigurationCallback)${project.version} - Copyright © 2003-2015 The Apache Software Foundation.