JavaScriptSupport
and may be removed after Tapestry 5.3.public interface RenderSupport
The methods in this interface are largely being replaced with a new environmental interface,
JavaScriptSupport
.
RenderSupport is normally accessed within a component by using the Environmental
annotation on a component
field. In addition, RenderSupport may also be accessed as a service (the service
internally delegates to the current environmental instance), which is useful
for service-layer objects.
Modifier and Type | Method and Description |
---|---|
void |
addClasspathScriptLink(String... classpaths)
Deprecated.
Use
JavaScriptSupport.importJavaScriptLibrary(Asset) instead |
void |
addInit(String functionName,
JSONArray parameterList)
Deprecated.
Use
JavaScriptSupport.addInitializerCall(String, JSONObject) instead (which may require
changes to your JavaScript initializer function) |
void |
addInit(String functionName,
JSONObject parameter)
Deprecated.
|
void |
addInit(String functionName,
String... parameters)
Deprecated.
Use
JavaScriptSupport.addInitializerCall(String, JSONObject) instead (which may require
changes to your JavaScript initializer function), or (for a single parameter)
JavaScriptSupport.addInitializerCall(String, String) |
void |
addScript(String script)
Deprecated.
Use
JavaScriptSupport.addScript(String, Object...) instead |
void |
addScript(String format,
Object... arguments)
Deprecated.
Use
JavaScriptSupport.addScript(String, Object...) instead |
void |
addScriptLink(Asset... scriptAssets)
Deprecated.
Use
JavaScriptSupport.importJavaScriptLibrary(Asset) instead |
void |
addScriptLink(String... scriptURLs)
Deprecated.
|
void |
addStylesheetLink(Asset stylesheet,
String media)
Deprecated.
Adds a link to a CSS stylesheet.
|
void |
addStylesheetLink(String stylesheetURL,
String media)
Deprecated.
Adds a stylesheet as a URL.
|
String |
allocateClientId(ComponentResources resources)
Deprecated.
|
String |
allocateClientId(String id)
Deprecated.
Use
JavaScriptSupport.allocateClientId(String) instead |
void |
autofocus(FieldFocusPriority priority,
String fieldId)
Deprecated.
Invoked to set focus on a rendered field.
|
String allocateClientId(String id)
JavaScriptSupport.allocateClientId(String)
insteadid
- the component id from which a unique id will be generatedIdAllocator
,
JavaScriptSupport.allocateClientId(ComponentResources)
String allocateClientId(ComponentResources resources)
JavaScriptSupport.allocateClientId(ComponentResources)
insteadallocateClientId(String)
but uses the id of the component extracted from the resources.resources
- of the component which requires an idvoid addScriptLink(Asset... scriptAssets)
JavaScriptSupport.importJavaScriptLibrary(Asset)
insteadscriptAssets
- asset to the script to addvoid addScriptLink(String... scriptURLs)
JavaScriptSupport.importJavaScriptLibrary(String)
insteadscriptURLs
- URL strings of scriptsRuntimeException
- always as of 5.2.0void addClasspathScriptLink(String... classpaths)
JavaScriptSupport.importJavaScriptLibrary(Asset)
insteadclasspaths
- array of paths. Symbols in the paths are expanded, then the paths are each converted into an
asset.void addStylesheetLink(Asset stylesheet, String media)
stylesheet
- the asset referencing the stylesheetmedia
- the media value for the stylesheet, or null to not specify a specific media typevoid addStylesheetLink(String stylesheetURL, String media)
addScriptLink(String[])
.stylesheetURL
- URL string of stylesheetmedia
- media value for the stylesheet, or null to not specify a specific media typevoid addScript(String script)
JavaScriptSupport.addScript(String, Object...)
insteadscript
- text to be added to the script blockvoid addScript(String format, Object... arguments)
JavaScriptSupport.addScript(String, Object...)
insteadString.format(String, Object[])
before being added to the script block. A newline will be added after the
formatted statement.format
- base string format, to be passed through String.formatarguments
- additional arguments formatted to form the final scriptvoid addInit(String functionName, JSONArray parameterList)
JavaScriptSupport.addInitializerCall(String, JSONObject)
instead (which may require
changes to your JavaScript initializer function)functionName
- the name of the function (on the client-side Tapestry.Initializer object) to invoke.parameterList
- list of parameters for the method invocation.addScript(String, Object[])
void addInit(String functionName, JSONObject parameter)
JavaScriptSupport.addInitializerCall(String, JSONObject)
insteadaddInit(String, org.apache.tapestry5.json.JSONArray)
where just a single object is
passed.functionName
- the name of the function (on the client-side Tapestry object) to invoke.parameter
- the object to pass to the functionvoid addInit(String functionName, String... parameters)
JavaScriptSupport.addInitializerCall(String, JSONObject)
instead (which may require
changes to your JavaScript initializer function), or (for a single parameter)
JavaScriptSupport.addInitializerCall(String, String)
addInit(String, org.apache.tapestry5.json.JSONArray)
where one or more strings are
passed. A single string is added to the initialization call as itself; otherwise, the parameters are combined to
form a JSONArray
. This method is deprecated and, although it still works, it now generates
very verbose, inefficient client-side JavaScript.functionName
- the name of the function (on the client-side Tapestry object) to invoke.parameters
- void autofocus(FieldFocusPriority priority, 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 focusCopyright © 2003-2012 The Apache Software Foundation.