BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.

com.bea.wlw.netui.tags.html
Class ScriptContainer

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.bea.wlw.netui.tags.AbstractBaseTag
              extended by com.bea.wlw.netui.tags.html.ScriptContainer
All Implemented Interfaces:
HtmlConstants, ScriptReporter, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
Html

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.

See Also:
Serialized Form
Beadoc.see:
<netui:scriptContainer> Tag Sample
Beadoc.tagdescription:
Acts as a container that will bundle up JavaScript created by other <netui...> tags, and outputs it within a single <script> tag. This is especially useful 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 in other JSP pages. Having redundant <html> ... </html> tags in the rendered Portlet JSP can result in display problems for some browsers. On the other hand, 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.

The <netui:scriptContainer> ... </netui:scriptContainer> tag set should enclose those <netui:...> tags that you want included in the script container. The first <netui:scriptContainer> tag should appear after the JSP's <body> tag. The closing </netui:scriptContainer> tag should appear before the JSP's </body> tag.

Sample Code

[BEA_HOME]\weblogic81\samples\workshop\SamplesApp\WebApp\tagSamples\netui\scriptContainer\


Field Summary
 
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ScriptContainer()
           
 
Method Summary
 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.
 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 isScriptWritten()
          This method indicates that the writeScript method has been called.
protected  void localRelease()
          Release any acquired resources.
 String nextTagIdRef(String tagId)
           
protected  void processIdMap()
           
protected  String replaceTagNameRefs(String content)
           
 String resolveTagIdRef(String tagIdRef)
           
 void setScopeId(String scopeId)
          Set the scopeId associated with the code methods
 void writeScript(weblogic.utils.UnsyncStringBuffer sb)
          This method will output all of the Script associated with the script reporter.
protected  void writeScriptBlock()
           
 
Methods inherited from class com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, containsExpression, evaluateAttributeToString, evaluateExpression, filter, filter, formatErrorString, formatString, getAttribute, getErrorsReport, getExpressionEvaluator, getJavaScriptUtils, getNearestForm, getNextId, getQualifiedBundleName, getScriptReporter, getUserLocale, hasErrors, isExpression, prepForRendering, registerAttribute, registerError, registerTagError, release, removeAttribute, renderAttribute, renderAttributes, reportErrors, rewriteName, setPageContext, updateExpression, write
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Constructor Detail

ScriptContainer

public ScriptContainer()
Method Detail

getTagName

public String getTagName()
Returns the name of the Tag.

Specified by:
getTagName in class AbstractBaseTag

addScriptFunction

public void addScriptFunction(String script)
This method will add Script as a function.

Specified by:
addScriptFunction in interface ScriptReporter
Parameters:
script - the text of the function

addScriptCode

public void addScriptCode(String script)
This method will add Script as top level code that runs when the page is loaded.

Specified by:
addScriptCode in interface ScriptReporter
Parameters:
script - the text of the script

addTagId

public void addTagId(String tagId,
                     String tagName)
Adds a tagID and tagName to the Html's getId javascript function.

Specified by:
addTagId in interface ScriptReporter
Parameters:
tagId - - the id of a child tag.
tagName - - the name of a child tag.

writeScript

public void writeScript(weblogic.utils.UnsyncStringBuffer sb)
Description copied from interface: ScriptReporter
This method will output all of the Script associated with the script reporter.

Specified by:
writeScript in interface ScriptReporter
Parameters:
sb - The script is written into the provided StringBuffer. This value must not be null.

isScriptWritten

public boolean isScriptWritten()
Description copied from interface: ScriptReporter
This method indicates that the writeScript method has been called.

Specified by:
isScriptWritten in interface ScriptReporter

nextTagIdRef

public String nextTagIdRef(String tagId)

resolveTagIdRef

public String resolveTagIdRef(String tagIdRef)

setScopeId

public void setScopeId(String scopeId)
Set the scopeId associated with the code methods

Beadoc.attributedescription:
The id that is associated with the script methods.
Beadoc.attributesyntaxvalue:
string_scopeId
Beadoc.databindable:
false

getScopeId

public String getScopeId()
return the scopeId associated with the ScriptContainer


doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Save any body content of this tag, which will generally be the option(s) representing the values displayed to the user.

Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Write out the body content and report any errors that occured.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

writeScriptBlock

protected void writeScriptBlock()
                         throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

processIdMap

protected void processIdMap()

replaceTagNameRefs

protected String replaceTagNameRefs(String content)
                             throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

localRelease

protected void localRelease()
Release any acquired resources.

Overrides:
localRelease in class AbstractBaseTag

BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.