public class HideableSection extends StylableTag
Example:
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> <base:section id="my.section" title="Click to hide/show"> This is the contents of this section... </base:section>
Syntax:
<base:section id=... clazz=... showclazz=... hideclazz=... style=... contentstyle=... title=... visible=... ontoggle=... initial=show|hide context=... >
Attribute | Default value | Required | Description |
id | - | no | The ID of the section. The value of this attribute
goes directly into the standard id attribute.
This means that if you need a reference to the scetion object in your own
JavaScript code, you may for example use the following code:
|
clazz | note | no |
The value if this attribute goes directly into the standard HTML
class attribute both when the section contents is hidden or
visible.
|
showclazz | note | no |
The value if this attribute goes directly into the standard HTML
class attribute when the section contents is visible.
|
hideclazz | note | no |
The value if this attribute goes directly into the standard HTML
class attribute when the section contents is hidden.
|
style | - | no |
The value if this attribute goes directly into the standard HTML
style attribute. This allows you to apply different styles
to different sections.
|
contentstyle | - | no |
The value if this attribute goes directly into the standard HTML
style attribute of the content part. This allows you to apply different styles
to different sections.
|
title | no | The title of the section. | |
visible | true | no | If the section should be visible or not. |
initial | show | no |
If the value is hide the section is hidden, otherwise it
is visible. This setting is ignored if a context is given.
|
context | - | no |
An optional ItemContext object. If given the initial
atribute is ignored. The valus is instead taken from the context setting
section.id where id is replaced with the value of the
id attribute. This should have the value "1" to show the
section or "0" to hide the section. If a context is given the default
javascript method will also send an Ajax request to the web server which
will update the setting in the context with a new value for the
show/hide setting. Thus, all settings are remembered during a session
and also when the user returns to the next session.
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
contentStyle
Optional
style attribute for the content section |
private ItemContext |
context |
private java.lang.String |
hideClass |
private Page |
page
The parent <base:page> tag.
|
private static long |
serialVersionUID |
private java.lang.String |
showClass |
private boolean |
showInitially
If the section should be shown or hidden to start with.
|
private java.lang.String |
title
The title of the section.
|
private boolean |
visible
If the section should be visible or not.
|
id, pageContext
EVAL_BODY_AGAIN
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor and Description |
---|
HideableSection() |
Modifier and Type | Method and Description |
---|---|
int |
doEndTag() |
int |
doStartTag() |
java.lang.String |
getContentstyle() |
ItemContext |
getContext() |
java.lang.String |
getHideclazz() |
java.lang.String |
getInitial() |
java.lang.String |
getShowclazz() |
java.lang.String |
getTitle() |
boolean |
isVisible() |
void |
setContentstyle(java.lang.String contentStyle) |
void |
setContext(ItemContext context) |
void |
setHideclazz(java.lang.String clazz) |
void |
setInitial(java.lang.String initial) |
void |
setShowclazz(java.lang.String clazz) |
void |
setTitle(java.lang.String title) |
void |
setVisible(boolean visible) |
addDynamicAttributes, addIdAndStyles, getClazz, getDynamicActionAttributes, getDynamicAttribute, getFullClass, getIdPrefix, getStyle, getSubclass, initDefaultAttributes, setClazz, setDynamicAttribute, setMoreDynamicAttributes, setPageContext, setStyle, setSubclass
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
private static final long serialVersionUID
private Page page
private java.lang.String showClass
private java.lang.String hideClass
private java.lang.String contentStyle
style
attribute for the content sectionprivate java.lang.String title
private boolean visible
private boolean showInitially
private transient ItemContext context
public void setShowclazz(java.lang.String clazz)
public java.lang.String getShowclazz()
public void setHideclazz(java.lang.String clazz)
public java.lang.String getHideclazz()
public void setContentstyle(java.lang.String contentStyle)
public java.lang.String getContentstyle()
public void setTitle(java.lang.String title)
public java.lang.String getTitle()
public void setVisible(boolean visible)
public boolean isVisible()
public void setInitial(java.lang.String initial)
public java.lang.String getInitial()
public void setContext(ItemContext context)
public ItemContext getContext()
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class TagSupport
JspException
public int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class TagSupport
JspException