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 Visible

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.Visible
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 Visible
extends AbstractBaseTag
implements TemplateConstants

Tag that turns on or off display of the body content based upon the visible state of the tag.

Attribute Descriptions
AttributeRequiredRuntime Expression Evaluation Data Bindable
visibleNoNoNo
A boolean property indicating if the content is visible or not.
visibilityNoNoRead Only
Sets the visible property through an expression.
negateNoNoNo
Sets the negate property which will negate the visible state.

See Also:
Attribute, IncludeSection, Section, SetAttribute, Template, Serialized Form
Example:
The following sample shows content targeted at the "leftCol" placeholder. The <netui-template:visible> tag controls whether this content will be sent to its placeholder. The controlling boolean value is located in the Controller file under the property "leftColVisible".
  <netui-template:section name="leftCol">
      <netui-template:visible visiblity="{pageFlow.leftColVisible}">
          <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>
      </netui-template:visible>
  </netui-template:section>

Code Sample

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_template/template/templateUsingJSP.jsp
Beadoc.see:
<netui-template:...> Tags Sample
Beadoc.tagdescription:
This tag determines whether some HTML content is visible or not.

The <netui-template:visible> tag can wrap any HTML content within a content page. If visibility is turned on, then the content will fill its target placeholder in the template file. If visibility is turned off, then the content will not fill its target placeholder.

Visibility can be determined through either the visible attribute (which takes a boolean literal) or the visibility attribute (which takes a data binding expression that resolves to a boolean).


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
Visible()
           
 
Method Summary
 int doStartTag()
          Renders the body content if the visible state is true.
 String getTagName()
          Returns the name of the Tag.
 String getVisibility()
          Returns the expression used to set the visibility state.
 boolean isNegate()
          Returns the negate state of the tag.
 boolean isVisible()
          Returns the visible state of the tag.
protected  void localRelease()
          Resets all of the fields of the tag.
 void setNegate(boolean negate)
          Sets the negate state of the tag.
 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, doEndTag, 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

Visible

public Visible()
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.

isVisible

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

Returns:
true if the body content 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 content is visible.
Beadoc.attributesyntaxvalue:
Beadoc.databindable:
false

isNegate

public boolean isNegate()
Returns the negate state of the tag.

Returns:
true if the isVisible should be negated, false otherwise.

setNegate

public void setNegate(boolean negate)
Sets the negate state of the tag. If negate is true this will negate the meaning of the visible state.

Parameters:
negate - Boolean value representing the negate state.
Beadoc.attributedescription:
Boolean. If true, the visible attribute will be negated.
Beadoc.attributesyntaxvalue:
boolean_negate
Beadoc.databindable:
false

setVisibility

public void setVisibility(String expr)
                   throws javax.servlet.jsp.JspException
Sets the visible state of the tag through an expression.

Parameters:
expr - an expression will be checked to see if the body content is visible or not.
Throws:
javax.servlet.jsp.JspException
Beadoc.attributedescription:
Boolean. Determines if the content is visible. This attribute is the same at the visible, except that this attribute may take a data binding expression.
Beadoc.attributesyntaxvalue:
boolean_expression_visible
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
Renders the body content if the visible state is true. Otherwise nothing is rendered.

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_INCLUDE to evaluate the body content.
Throws:
javax.servlet.jsp.JspException - if there are errors.

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.