public class Button extends StylableTag
Example:
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> <base:button onclick="alert('click')" title="Click here"> </base:button>
Syntax:
<base:button id=... clazz=... subclass=... style=... onclick=... title=... tooltip=... image=... visible=true|false disabled=true|false tabindex=... >
Attribute | Default value | Required | Description |
id | - | no | The ID of the button. The value of this attribute
goes directly into the standard id attribute.
This means that if you need a reference to the button object in your own
JavaScript code, you may for example use the following code:
|
clazz | basicbutton | no |
The value of this attribute goes directly into the standard HTML
class attribute. This allows you to apply different styles
to different buttons.
|
subclass | - | no | Additional classes to put in the HTML class attribute. Doesn't replace the main class attribute. |
style | - | no |
The value if this attribute goes directly into the standard HTML
style attribute. This allows you to apply different styles
to different buttons.
|
onclick | - | yes | Deprecated. Use javascript to add an click handler instead: Buttons.addClickHandler(). A JavaScript statement that will be excuted when the button is clicked. |
title | no | The title of the button. | |
tooltip | no | A short explanation that will show up as a tooltip. | |
image | no | An optional image to display. An image is automatically selected if the title is "Close", "Cancel", "Save", "Ok", "Yes" or "No". | |
visible | true | no | If the button should be visible or not. |
disabled | false | no | If the button should be enabled or not. |
tabindex | 0 | no | Tab index value to control the focus order. Use -1 to disable tabbing to the button. |
Modifier and Type | Field and Description |
---|---|
private ButtonGroup |
buttonGroup |
private static Map<String,String> |
defaultIds |
private static Map<String,String> |
defaultImages |
private boolean |
disabled
If the button should be enabled or not.
|
private String |
image
The image to display.
|
private static Pattern |
keepFirstWord |
private String |
onClick
Deprecated.
|
private static long |
serialVersionUID |
private int |
tabIndex |
private String |
title
The title of the button.
|
private String |
tooltip
An optional tooltip.
|
private boolean |
visible
If the button should be visible or not.
|
id, pageContext
EVAL_BODY_AGAIN
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor and Description |
---|
Button() |
Modifier and Type | Method and Description |
---|---|
int |
doStartTag() |
private String |
getDefaultId(String theTitle) |
private String |
getDefaultImage(String theTitle) |
String |
getId() |
String |
getImage() |
String |
getOnclick()
Deprecated.
|
int |
getTabindex() |
String |
getTitle() |
String |
getTooltip() |
boolean |
isDisabled() |
boolean |
isVisible() |
void |
setDisabled(boolean disabled) |
void |
setImage(String image) |
void |
setOnclick(String onClick)
Deprecated.
|
void |
setTabindex(int tabIndex) |
void |
setTitle(String title) |
void |
setTooltip(String tooltip) |
void |
setVisible(boolean visible) |
addDynamicAttributes, addIdAndStyles, getClazz, getDynamicActionAttributes, getDynamicAttribute, getFullClass, getIdPrefix, getStyle, getSubclass, setClazz, setDynamicAttribute, setMoreDynamicAttributes, setPageContext, setStyle, setSubclass
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
private static final long serialVersionUID
private ButtonGroup buttonGroup
@Deprecated private String onClick
private String title
private String tooltip
private boolean visible
private boolean disabled
private String image
private int tabIndex
private static final Pattern keepFirstWord
public String getId()
getId
in class TagSupport
@Deprecated public void setOnclick(String onClick)
@Deprecated public String getOnclick()
public void setTitle(String title)
public String getTitle()
public void setImage(String image)
public String getImage()
public void setTooltip(String tooltip)
public String getTooltip()
public void setVisible(boolean visible)
public boolean isVisible()
public void setDisabled(boolean disabled)
public boolean isDisabled()
public void setTabindex(int tabIndex)
public int getTabindex()
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class TagSupport
JspException