|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface RenderSupport
Provides support to all components that render. This is primarily about generating unique client-side ids (very important for JavaScript generation) as well as accumulating JavaScript to be sent to the client. PageRenderSupport also allows for the incremental addition of stylesheets.
When rendering, a <script> block will be added to the bottom of the page (just before the </body> tag). The scripting statements added to this block will be executed, on the client, only once the page has fully loaded.
| Method Summary | |
|---|---|
void |
addClasspathScriptLink(String... classpaths)
Used to add scripts that are stored on the classpath. |
void |
addInit(String functionName,
JSONArray parameterList)
Add an initialization call. |
void |
addInit(String functionName,
JSONObject parameter)
Alternate version of addInit(String, org.apache.tapestry5.json.JSONArray) where just a single object is
passed. |
void |
addInit(String functionName,
String... parameters)
Alternate version of addInit(String, org.apache.tapestry5.json.JSONArray) where one or more strings are
passed. |
void |
addScript(String script)
Adds a script statement to the page's script block. |
void |
addScript(String format,
Object... arguments)
Adds a script statement to the page's script block. |
void |
addScriptLink(Asset... scriptAssets)
Adds one or more new script assets to the page. |
void |
addScriptLink(String... scriptURLs)
Adds some number of script links as strings representations of URLs. |
void |
addStylesheetLink(Asset stylesheet,
String media)
Adds a link to a CSS stylesheet. |
void |
addStylesheetLink(String stylesheetURL,
String media)
Adds a stylesheet as a URL. |
String |
allocateClientId(ComponentResources resources)
As with allocateClientId(String) but uses the id of the component extracted from the resources. |
String |
allocateClientId(String id)
Allocates a unique id based on the component's id. |
void |
autofocus(FieldFocusPriority priority,
String fieldId)
Invoked to set focus on a rendered field. |
| Method Detail |
|---|
String allocateClientId(String id)
id - the component id from which a unique id will be generated
IdAllocatorString allocateClientId(ComponentResources resources)
allocateClientId(String) but uses the id of the component extracted from the resources.
resources - of the component which requires an id
void addScriptLink(Asset... scriptAssets)
scriptAssets - asset to the script to addvoid addScriptLink(String... scriptURLs)
scriptURLs - URL strings of scriptsvoid addClasspathScriptLink(String... classpaths)
classpaths - 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 type
void addStylesheetLink(String stylesheetURL,
String media)
addScriptLink(String[]).
stylesheetURL - URL string of stylesheetmedia - media value fo the stylesheet, or null to not specify a specific media typevoid addScript(String script)
script - text to be added to the script block
void addScript(String format,
Object... arguments)
String.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 script
void addInit(String functionName,
JSONArray parameterList)
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)
addInit(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 function
void addInit(String functionName,
String... parameters)
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.
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 focus
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||