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.template
Class Section

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.template.Section
All Implemented Interfaces:
HtmlConstants, TemplateConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class Section
extends AbstractBaseTag
implements TemplateConstants

Used within a content page to provide content for a placeholder section defined within a template. The body content of the tag is passed to the IncludeSection tag in the template providing the content for that section. If the name attribute matches a name attribute on a IncludeSection tag in the template, the body content of this tag will be rendered.

Attribute Descriptions
AttributeRequiredRuntime Expression Evaluation Data Bindable
nameYesNoNo
The name of the IncludeSection tag in the template that the tags provides content for.
visibleNoNoNo
A boolean property indicating if the content is visible or not.
visibilityNoNoRead Only
Sets the visible property through an expression.

See Also:
Attribute, IncludeSection, SetAttribute, Template, Visible, Serialized Form
Example:
Assume a <netui-template:includeSection> tag defines a content placeholder inside a table row
    <tr>
        <netui-template:includeSection name="rowPlaceholder"/>
    </tr>

A content page can set content into the placeholder using the <netui-template:section> tag as follows.

  <netui-template:section name="rowPlaceHolder">
      <td><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, 
      sed diam nonummy nibh euismod tincidunt ut laoreet dolore 
      magna aliquam erat volutpat. Ut wisi enim ad minim veniam, 
      quis nostrud exerci tation ullamcorper suscipit lobortis nisl 
      ut aliquip ex ea commodo consequat.</p></td>
  </netui-template:section>
The HTML rendered in the browser will appear as follows.
    <tr>
      <td><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, 
      sed diam nonummy nibh euismod tincidunt ut laoreet dolore 
      magna aliquam erat volutpat. Ut wisi enim ad minim veniam, 
      quis nostrud exerci tation ullamcorper suscipit lobortis nisl 
      ut aliquip ex ea commodo consequat.</p></td>
    </tr>

Code Sample

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_template/template/template.jsp [BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_template/template/templateUsingJSP.jsp
Beadoc.see:
<netui-template:...> Tags Sample
Beadoc.tagdescription:
The <netui-template:section> tag sets HTML content inside placeholders defined by IncludeSection tags.

The <netui-template:section> tag must have a parent Template tag.

The <netui-template:section> tag appears in content pages, which adopt a template page, set properties on the template's placeholders (using this <netui-template:section> tag), and render the completed HTML in the browser.

For content to be placed in the placeholder, the <netui-template:section> and <netui-template:includeSection> tags must have matching name attributes.

For example, assume a template page defines the following content placeholder.

In the template JSP page...

      <table>
          <tr>
              <td colspan="3">
                  <netui-template:includeSection name="tableHeader"/>
              </td>
          </tr>

Then a content page can set HTML content in the placeholder using the <netui-template:section> tag.

In a content JSP page...

    <netui-template:section name="tableHeader">
        <h1>HEADER TEXT</h1>
    </netui-template:section>

The HTML rendered in the browser will appear as follows.

      <table>
          <tr>
              <td colspan="3">
                  <h1>HEADER TEXT</h1>
              </td>
          </tr>

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.template.TemplateConstants
TEMPLATE_ATTRIBUTES, TEMPLATE_SECTIONS
 
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
Section()
           
 
Method Summary
 int doEndTag()
          Stores the buffered body content into the TEMPLATE_SECTIONS HashMap.
 int doStartTag()
          Causes the content of the section to be rendered into a buffer.
 String getName()
          Get the name of the IncludeSection.
 String getTagName()
          Returns the name of the Tag.
 String getVisibility()
          Returns the expression used to set the visibility state.
 boolean isVisible()
          Returns the visible state of the tag.
protected  void localRelease()
          Resets all of the fields of the tag.
 void setName(String name)
          Sets the name of the placeholder section defined in the template that this tag is providing content for.
 void setVisibility(String expr)
          Sets the visible state of the tag through an expression.
 void setVisible(boolean visible)
          Sets the visible state of the tag.
 
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
doAfterBody, 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

Section

public Section()
Method Detail

getTagName

public String getTagName()
Returns the name of the Tag. This is used to identify the type of tag reporting errors.

Specified by:
getTagName in class AbstractBaseTag
Returns:
a constant string representing the name of the tag.

setName

public void setName(String name)
Sets the name of the placeholder section defined in the template that this tag is providing content for. This name is matched against the IncludeSection name. If the names match, the content of this tag will be rendered within the template's section.

Parameters:
name - The name of an IncludeSection the this tag is providing content for.
Beadoc.attributedescription:
The name of the content to fill the placeholder. This name is matched against the <netui-template:includeSection> name. If the names match, the content of this tag will be rendered within the template's placeholder.
Beadoc.attributesyntaxvalue:
string_name
Beadoc.databindable:
false

getName

public String getName()
Get the name of the IncludeSection.

Returns:
the IncludeSection name.

isVisible

public boolean isVisible()
Returns the visible state of the tag.

Returns:
true if the section is visible, false otherwise.

setVisible

public void setVisible(boolean visible)
Sets the visible state of the tag.

Parameters:
visible - Boolean value representing the visible state.
Beadoc.attributedescription:
Boolean. Determines if the section is visible.
Beadoc.attributesyntaxvalue:
boolean_literal_visible
Beadoc.databindable:
false

setVisibility

public void setVisibility(String expr)
Sets the visible state of the tag through an expression.

Parameters:
expr - an expression will be checked to see if the section is visible or not.
Beadoc.attributedescription:
Boolean. Determines if the section is visible. This attribute is the same at the visible attribute, except that this attribute may take a data binding expression.
Beadoc.attributesyntaxvalue:
boolean_expression_visiblity
Beadoc.databindable:
Read Only

getVisibility

public String getVisibility()
Returns the expression used to set the visibility state.

Returns:
a String expression

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Causes the content of the section to be rendered into a buffer.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
SKIP_BODY if the visible state is false, otherwise EVAL_BODY_BUFFERED to cause the body content to be buffered.
Throws:
javax.servlet.jsp.JspException - if there are errors.

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Stores the buffered body content into the TEMPLATE_SECTIONS HashMap. The buffered body is accessed by the template page to obtain the content for IncludeSection tags.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_PAGE to continue evaluating the page.
Throws:
javax.servlet.jsp.JspException - on error.

localRelease

protected void localRelease()
Resets all of the fields of the tag.

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.