ScriptContainer Class

com.bea.wlw.netui.tags.html
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
AttributeRequiredRuntime Expression EvaluationData Bindable
scopeIDNoNoNo
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

Field Summary

   
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
 
Fields from  javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields from  javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 

Constructor Summary

ScriptContainer()

 

Method Summary

public void
addScriptCode(String s)
This method will add Script as top level code that runs when the page is loaded.
public void
addScriptFunction(String s)
This method will add Script as a function.
public void
addTagId(String tagId, String tagName)
Adds a tagID and tagName to the Html's getId javascript function.
public int
doAfterBody()
Save any body content of this tag, which will generally be the option(s) representing the values displayed to the user.
public int
doEndTag()
Write out the body content and report any errors that occured.
public int
doStartTag()
public String
getScopeId()
return the scopeId associated with the ScriptContainer
public String
getTagName()
Returns the name of the Tag.
protected void
localRelease()
Release any acquired resources.
public String
nextTagIdRef(String tagId)
protected void
processIdMap()
protected String
replaceTagNameRefs(String content)
public String
resolveTagIdRef(String tagIdRef)
public void
setScopeId(String scopeId)
Set the scopeId associated with the code methods
protected void
writeScriptBlock()
 
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.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
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
   
Methods from interface javax.servlet.jsp.tagext.BodyTag
doInitBody, setBodyContent
 
Methods from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
 
Methods from interface com.bea.wlw.netui.tags.ScriptReporter
addScriptCode, addScriptFunction, addTagId
 
Methods from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent
 

Constructor Detail

ScriptContainer

public ScriptContainer()
 

Method Detail

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