|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTagSupport
BodyTagSupport
AbstractClassicTag
ScriptContainer
public class ScriptContainer
Acts as a container that will bundle up JavaScript created by other NetUI tags, and output it within a single <script> tag. This is especially needed for Portal web applications, because they often cannot rely on having <html> ... </html> tags to provide a default container. In a portlet, some JSP pages might be included into other JSP pages. Having redundant <html> ... </html> tags in the rendered portlet JSP can result in display problems for some browsers. However, omitting the <html> tag (and the container it provides) can result in cluttered code, especially where Javascript appears in the file. To solve this issue, WebLogic Workshop provides the <netui:scriptContainer> tag.
Field Summary |
---|
Fields inherited from class AbstractClassicTag |
---|
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT |
Fields inherited from class BodyTagSupport |
---|
bodyContent |
Fields inherited from class TagSupport |
---|
id, pageContext |
Fields inherited from interface BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
ScriptContainer()
|
Method Summary | |
---|---|
void |
addAnchorPostRewriter(String rewriter)
This method will add a method to be called which will handle state changes associated with an anchor post. |
protected void |
addAnchorRewriters()
Add the anchor rewriter code. |
protected void |
addInitCode()
This method will add the initialization code to NetUI. |
void |
addInitMethod(String varClass)
This method will add a new method to the initialization code. |
void |
addScriptCode(String script)
This method will add Script as top level code that runs when the page is loaded. |
void |
addScriptFunction(String script)
This method will add Script as a function. |
void |
addTagId(String tagId,
String tagName)
Adds a tagID and tagName to the Html's getId javascript function. |
protected void |
defineNetUIScope(StringBuilder sb)
This method will define the NetUI constructor. |
int |
doAfterBody()
Save any body content of this tag, which will generally be the option(s) representing the values displayed to the user. |
int |
doEndTag()
Write out the body content and report any errors that occured. |
int |
doStartTag()
|
String |
getScopeId()
return the scopeId associated with the ScriptContainer |
String |
getTagName()
Returns the name of the Tag. |
boolean |
isInitScriptWritten()
Returns true if the writeInitScript method has been called. |
boolean |
isRunAtClient()
Return the runAtClient state of the container. |
boolean |
isScriptWritten()
This method indicates that the writeScript method has been called. |
protected void |
localRelease()
Release any acquired resources. |
void |
setRunAtClient(boolean runAtClient)
Boolean indicating that the script container is supporting RunAtClient features. |
void |
setScopeId(String scopeId)
Set the scopeId associated with the code methods |
void |
writeInitScript(StringBuilder sb)
This method will output all of the Script that appears inside the tag. |
void |
writeScript(StringBuilder sb)
This method will output all of the Script associated with the script reporter. |
protected String |
writeScriptBlock()
This will write the script block. |
Methods inherited from class BodyTagSupport |
---|
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Tag |
---|
getParent, setPageContext, setParent |
Constructor Detail |
---|
public ScriptContainer()
Method Detail |
---|
public String getTagName()
getTagName
in interface INetuiTag
getTagName
in class AbstractClassicTag
public void addScriptFunction(String script)
addScriptFunction
in interface IScriptReporter
script
- the text of the function. This value must not be null.public void addScriptCode(String script)
addScriptCode
in interface IScriptReporter
script
- the text of the scriptpublic void addTagId(String tagId, String tagName)
addTagId
in interface IScriptReporter
tagId
- - the id of a child tag.tagName
- - the name of a child tag.public void addInitMethod(String varClass)
addInitMethod
in interface IScriptReporter
varClass
- the name of the variable containing the javascript featurepublic void addAnchorPostRewriter(String rewriter)
addAnchorPostRewriter
in interface IScriptReporter
rewriter
- the name of a method which will rewrite the anchor.public void writeScript(StringBuilder sb)
writeScript
in interface IScriptReporter
sb
- The script is written into the provided StringBuffer. This value must not be null.public void writeInitScript(StringBuilder sb)
writeInitScript
in interface IScriptReporter
sb
- The script is written into the provided StringBuffer. This value must not be null.public boolean isScriptWritten()
IScriptReporter
writeScript
method has been called.
isScriptWritten
in interface IScriptReporter
public boolean isInitScriptWritten()
writeInitScript
method has been called.
isInitScriptWritten
in interface IScriptReporter
true
if the writeInitScript
method has been called.public void setScopeId(String scopeId)
public String getScopeId()
public void setRunAtClient(boolean runAtClient)
runAtClient
- boolean flag indicating we are running at the clientpublic boolean isRunAtClient()
isRunAtClient
in interface IScriptReporter
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class BodyTagSupport
JspException
public int doAfterBody() throws JspException
doAfterBody
in interface IterationTag
doAfterBody
in class BodyTagSupport
JspException
- if a JSP exception has occurredpublic int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class BodyTagSupport
JspException
- if a JSP exception has occurredprotected void addInitCode()
protected void defineNetUIScope(StringBuilder sb)
sb
- A StringBuffer to write the new script block intoprotected void addAnchorRewriters()
runAtClient
is set on
the script container.
protected String writeScriptBlock()
protected void localRelease()
localRelease
in class AbstractClassicTag
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |