ScriptContainer Class
- public class ScriptContainer
extends AbstractBaseTag
implements ScriptReporter
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.
| Attribute Descriptions |
| Attribute | Required | Runtime Expression Evaluation | Data Bindable |
| scopeID | No | No | No |
| The ID that is associated with the code methods. |
Related Topics
<netui:scriptContainer> Tag Sample
-
Hierarchy
-
Object
TagSupport
BodyTagSupport
AbstractBaseTag
ScriptContainer
-
All Implemented Interfaces
-
BodyTag, IterationTag, ScriptReporter, Serializable, Tag
-
Direct Known Subclasses
-
Html
Fields from com.bea.wlw.netui.tags.AbstractBaseTag |
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, CLASS, ID, JAVASCRIPT_STATUS, NAME, NETUI_UNIQUE_CNT, ONCLICK, ONDBLCLICK, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, STYLE, TABINDEX |
Methods from com.bea.wlw.netui.tags.AbstractBaseTag |
addTagIdMapping, evaluateAttributeToString, filter, filter, getJavaScriptUtils, getNearestForm, getScriptReporter, getUserLocale, registerTagError, release, renderAttribute, rewriteName, write |
Methods from javax.servlet.jsp.tagext.TagSupport |
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScriptContainer
public ScriptContainer()
addScriptCode(String) Method
public void addScriptCode(String s)
This method will add Script as top level code that runs when
the page is loaded.
Parameters
-
s
- the text of the script
addScriptFunction(String) Method
public void addScriptFunction(String s)
This method will add Script as a function.
Parameters
-
s
- the text of the function
addTagId(String, String) Method
public void addTagId(String tagId,
String tagName)
Adds a tagID and tagName to the Html's getId javascript function.
Parameters
-
tagId
- - the id of a child tag.
-
tagName
- - the name of a child tag.
doAfterBody() Method
public int doAfterBody()
throws JspException
Save any body content of this tag, which will generally be the
option(s) representing the values displayed to the user.
-
Overrides
-
BodyTagSupport.doAfterBody()
Exceptions
-
JspException
- if a JSP exception has occurred
doEndTag() Method
public int doEndTag()
throws JspException
Write out the body content and report any errors that occured.
-
Overrides
-
BodyTagSupport.doEndTag()
Exceptions
-
JspException
- if a JSP exception has occurred
doStartTag() Method
public int doStartTag()
throws JspException
-
Overrides
-
BodyTagSupport.doStartTag()
Exceptions
-
JspException
getScopeId() Method
public String getScopeId()
return the scopeId associated with the ScriptContainer
getTagName() Method
public String getTagName()
Returns the name of the Tag.
-
Overrides
-
AbstractBaseTag.getTagName()
localRelease() Method
protected void localRelease()
Release any acquired resources.
-
Overrides
-
AbstractBaseTag.localRelease()
nextTagIdRef(String) Method
public String nextTagIdRef(String tagId)
processIdMap() Method
protected void processIdMap()
replaceTagNameRefs(String) Method
protected String replaceTagNameRefs(String content)
throws JspException
Exceptions
-
JspException
resolveTagIdRef(String) Method
public String resolveTagIdRef(String tagIdRef)
setScopeId(String) Method
public void setScopeId(String scopeId)
Set the scopeId associated with the code methods
writeScriptBlock() Method
protected void writeScriptBlock()
throws JspException
Exceptions
-
JspException