|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.primix.tapestry.AbstractComponent | +--com.primix.tapestry.html.Body
The body of a Tapestry page. This is used since it allows components on the
page access to an initialization script (that is written the start, just before
the <body> tag). This is currently used by Rollover
and Script
components.
Fields inherited from class com.primix.tapestry.AbstractComponent |
id, page, specification, wrapped, wrappedCount |
Constructor Summary | |
Body()
|
Method Summary | |
void |
addOtherInitialization(java.lang.String script)
Adds other initialization, in the form of additional JavaScript code to execute from the <body>'s onLoad event
handler. |
void |
addOtherScript(java.lang.String script)
Adds additional scripting code to the page. |
static Body |
get(IRequestCycle cycle)
Retrieves the Body that was stored into the
request cycle. |
java.lang.String |
getPreloadedImageReference(java.lang.String URL)
Adds to the script an initialization for the named variable as an Image(), to the given URL. |
java.lang.String |
getUniqueId()
Returns a String that is unique for the current rendering of this Body component. |
void |
includeScript(java.lang.String URL)
Used to include a script from an outside URL. |
void |
process(ScriptSession session)
Invoked to process the contents of a ScriptSession . |
void |
render(IResponseWriter writer,
IRequestCycle cycle)
The principal rendering/rewinding method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Body()
Method Detail |
public java.lang.String getPreloadedImageReference(java.lang.String URL)
Returns a reference, a string that can be used to represent the preloaded image in a JavaScript function.
public void addOtherInitialization(java.lang.String script)
onLoad
event
handler. The caller is responsible for adding a semicolon (statement
terminator). This method will add a newline after the script.public void addOtherScript(java.lang.String script)
This is typically used to add some form of JavaScript
event handler to a page. For example, the
Rollover
component makes use of this.
Another way this is invoked is by using the
Script
component.
The string will be added, as-is, within
the <script> block generated by this Body
component.
The script should not contain HTML comments, those will
be supplied by this Body component.
A frequent use is to add an initialization function using
this method, then cause it to be executed using
addOtherInitialization(String)
.
public void includeScript(java.lang.String URL)
public static Body get(IRequestCycle cycle)
Body
that was stored into the
request cycle. This allows components wrapped by the
Body
to locate it and access the services it
provides.public java.lang.String getUniqueId()
public void render(IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
IRender
Renderring and rewinding are the exact same process. The same code that renders must be able to restore state by going through the exact same operations (even though the output is discarded).
public void process(ScriptSession session)
ScriptSession
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |