| com.sun.rave.web.ui.component.ButtonBase
All known Subclasses: com.sun.rave.web.ui.component.Button,
ButtonBase | abstract public class ButtonBase extends javax.faces.component.UICommand (Code) | | Use the ui:button tag to display
an input button in the rendered HTML page. The input button submits the
associated form when activated by the user. The
corresponding ActionEvent events then occur on the server.
HTML
Elements and Layout
This tag uses the XHTML
<input> element to create a button with a
text label.
Client
Side Javascript Functions
The button component supports a client side javascript
object. To use this object all you need to do is get the
object by using document.getElementById() function to get the
object. It is recommended though you pass the result of the
getElementById() function to a local variable rather than accessing the
functions directly. The object supports the following
functions:
- isMini():
Test if button style is "mini" for
the button. Returns a boolean.
- isPrimary(): Test
if button style is "primary" for
the button. Returns a boolean.
- isSecondary():
DEPRECATED
use isPrimary instead Test
if button style is "secondary" for
the button. Returns a boolean.
- setMini(mini):
Set button style to "mini"
for the button. If
the mini attribute
is set to true,
the
element is shown with mini styles.
- setPrimary(primary):
Set button style
to "primary" for the
given button. If the primary attribute
is set to
true, the element is shown with primary style.
- setSecondary(secondary):
DEPRECATED
use setPrimary instead Set
button style
to "secondary" for the
given button. If the secondary attribute
is set to
true, the element is shown with secondary styles.
There are two other common functions that are useful for a button.
- common_stripStyleClass(javascriptObj,
classToRemove): Use this
function to remove a style class from a any js object that supports the
class property. Takes a javascript object and the style class
string to remove.
- common_addStyleClass(this,
newType): Use this function
to add a new style class to any js object that supports the class
property. Takes a javascript object and the style class string to add.
Examples
Example 1: Create a primary
button:
<ui:button
id="button1" text="#{ButtonBean.text}"
action="#{ButtonBean.success}" />
Example 2: Create a primary
mini button:
<ui:button
id="button1" text="#{ButtonBean.text}"
action="#{ButtonBean.success}" mini="true" />
Example 3: Create a secondary
button:
<ui:button
id="button1" text="#{ButtonBean.text}"
action="#{ButtonBean.success}" secondary="true" />
Example 4: Create a secondary
mini button:
<ui:button
id="button1" text="#{ButtonBean.text}"
action="#{ButtonBean.success}" secondary="true" isMini="true" />
Example 5: Create a reset
button:
<ui:button
id="button1"
text="#{ButtonBean.text}" action="#{ButtonBean.success}" reset="true"
/>
Example 6: Create an image
button:
<ui:button
id="button1" imageURL="#{ButtonBean.image}"
action="#{ButtonBean.success}" />
Auto-generated component class.
Do NOT modify; all changes
will be lost!
|
ButtonBase | public ButtonBase()(Code) | | Construct a new ButtonBase .
|
getAction | public javax.faces.el.MethodBinding getAction()(Code) | | Method binding representing a method that processes
application actions from this component.
|
getActionListener | public javax.faces.el.MethodBinding getActionListener()(Code) | | Method binding representing a method that receives action from this, and possibly other, components.
|
getAlt | public String getAlt()(Code) | | Alternative text description used by screen reader tools
|
getFamily | public String getFamily()(Code) | | Return the identifier of the component family to which this
component belongs. This identifier, in conjunction with the value
of the rendererType property, may be used to select
the appropriate
Renderer for this component instance.
|
getImageURL | public String getImageURL()(Code) | | Resource path of an image to be displayed to create the visual
appearance of this button instead of the standard button image. Either
the "imageURL" or "text" attributes must be specified. When an
imageURL value is given, the button type is set to "image".
|
getOnBlur | public String getOnBlur()(Code) | | Scripting code executed when this element loses focus.
|
getOnClick | public String getOnClick()(Code) | | Scripting code executed when a mouse click
occurs over this component.
|
getOnDblClick | public String getOnDblClick()(Code) | | Scripting code executed when a mouse double click
occurs over this component.
|
getOnFocus | public String getOnFocus()(Code) | | Scripting code executed when this component receives focus. An
element receives focus when the user selects the element by pressing
the tab key or clicking the mouse.
|
getOnKeyDown | public String getOnKeyDown()(Code) | | Scripting code executed when the user presses down on a key while the
component has focus.
|
getOnKeyPress | public String getOnKeyPress()(Code) | | Scripting code executed when the user presses and releases a key while
the component has focus.
|
getOnKeyUp | public String getOnKeyUp()(Code) | | Scripting code executed when the user releases a key while the
component has focus.
|
getOnMouseDown | public String getOnMouseDown()(Code) | | Scripting code executed when the user presses a mouse button while the
mouse pointer is on the component.
|
getOnMouseMove | public String getOnMouseMove()(Code) | | Scripting code executed when the user moves the mouse pointer while
over the component.
|
getOnMouseOut | public String getOnMouseOut()(Code) | | Scripting code executed when a mouse out movement
occurs over this component.
|
getOnMouseOver | public String getOnMouseOver()(Code) | | Scripting code executed when the user moves the mouse pointer into
the boundary of this component.
|
getOnMouseUp | public String getOnMouseUp()(Code) | | Scripting code executed when the user releases a mouse button while
the mouse pointer is on the component.
|
getStyle | public String getStyle()(Code) | | CSS style(s) to be applied when this component is rendered.
|
getStyleClass | public String getStyleClass()(Code) | | CSS style class(es) to be applied when this component is rendered.
|
getTabIndex | public int getTabIndex()(Code) | | The position of this component in the tabbing order sequence
|
getText | public Object getText()(Code) | | Textual label used to create the visual appearance of this button.
Either the "imageURL" or "text" attributes must be specified. When a
text value is given, the standard button image is used, with the
specified text displayed on the button.
|
getToolTip | public String getToolTip()(Code) | | Display the text as a tooltip for this component
|
getValueBinding | public ValueBinding getValueBinding(String name)(Code) | | Return the ValueBinding stored for the
specified name (if any), respecting any property aliases.
Parameters: name - Name of value binding to retrieve |
isDisabled | public boolean isDisabled()(Code) | | Indicates that activation of this component by the user is not currently
permitted. In this component library, the disabled attribute also causes
the button to be renderered using a particular style.
|
isEscape | public boolean isEscape()(Code) | | Escape HTML markup in the button text
|
isMini | public boolean isMini()(Code) | | Indicates that the button should be rendered using a different style
than normal buttons. If the value is set to true, the button shall
appear somewhat smaller than a normal button. Mini buttons are useful
in situations where a button applies to an individual field on the
page, rather than a section, table, or whole page.
|
isNoTextPadding | public boolean isNoTextPadding()(Code) | | Indicates that padding should not be applied to the button text. By
default, whitespace characters are padded to button text greater than
or equal to 4 characters in length. If the value is set to true, no
padding is applied.
|
isPrimary | public boolean isPrimary()(Code) | | Indicates that the button is the most commonly used button within a
group.
|
isReset | public boolean isReset()(Code) | | Indicates that the button should be a HTML reset button. By default,
this value is false and the button is created as a submit button. If the
value is set to true, no action listener will be invoked.
|
isVisible | public boolean isVisible()(Code) | | Use the visible attribute to indicate whether the component should be
viewable by the user in the rendered HTML page. If set to false, the
HTML code for the component is present in the page, but the component
is hidden with style attributes. By default, visible is set to true, so
HTML for the component HTML is included and visible to the user. If the
component is not visible, it can still be processed on subsequent form
submissions because the HTML is present.
|
restoreState | public void restoreState(FacesContext _context, Object _state)(Code) | | Restore the state of this component.
|
saveState | public Object saveState(FacesContext _context)(Code) | | Save the state of this component.
|
setAction | public void setAction(javax.faces.el.MethodBinding action)(Code) | | Method binding representing a method that processes
application actions from this component.
See Also: ButtonBase.getAction() |
setActionListener | public void setActionListener(javax.faces.el.MethodBinding actionListener)(Code) | | Method binding representing a method that receives action from this, and possibly other, components.
See Also: ButtonBase.getActionListener() |
setDisabled | public void setDisabled(boolean disabled)(Code) | | Indicates that activation of this component by the user is not currently
permitted. In this component library, the disabled attribute also causes
the button to be renderered using a particular style.
See Also: ButtonBase.isDisabled() |
setImageURL | public void setImageURL(String imageURL)(Code) | | Resource path of an image to be displayed to create the visual
appearance of this button instead of the standard button image. Either
the "imageURL" or "text" attributes must be specified. When an
imageURL value is given, the button type is set to "image".
See Also: ButtonBase.getImageURL() |
setMini | public void setMini(boolean mini)(Code) | | Indicates that the button should be rendered using a different style
than normal buttons. If the value is set to true, the button shall
appear somewhat smaller than a normal button. Mini buttons are useful
in situations where a button applies to an individual field on the
page, rather than a section, table, or whole page.
See Also: ButtonBase.isMini() |
setNoTextPadding | public void setNoTextPadding(boolean noTextPadding)(Code) | | Indicates that padding should not be applied to the button text. By
default, whitespace characters are padded to button text greater than
or equal to 4 characters in length. If the value is set to true, no
padding is applied.
See Also: ButtonBase.isNoTextPadding() |
setOnFocus | public void setOnFocus(String onFocus)(Code) | | Scripting code executed when this component receives focus. An
element receives focus when the user selects the element by pressing
the tab key or clicking the mouse.
See Also: ButtonBase.getOnFocus() |
setOnKeyDown | public void setOnKeyDown(String onKeyDown)(Code) | | Scripting code executed when the user presses down on a key while the
component has focus.
See Also: ButtonBase.getOnKeyDown() |
setOnKeyPress | public void setOnKeyPress(String onKeyPress)(Code) | | Scripting code executed when the user presses and releases a key while
the component has focus.
See Also: ButtonBase.getOnKeyPress() |
setOnMouseDown | public void setOnMouseDown(String onMouseDown)(Code) | | Scripting code executed when the user presses a mouse button while the
mouse pointer is on the component.
See Also: ButtonBase.getOnMouseDown() |
setOnMouseOver | public void setOnMouseOver(String onMouseOver)(Code) | | Scripting code executed when the user moves the mouse pointer into
the boundary of this component.
See Also: ButtonBase.getOnMouseOver() |
setOnMouseUp | public void setOnMouseUp(String onMouseUp)(Code) | | Scripting code executed when the user releases a mouse button while
the mouse pointer is on the component.
See Also: ButtonBase.getOnMouseUp() |
setPrimary | public void setPrimary(boolean primary)(Code) | | Indicates that the button is the most commonly used button within a
group.
See Also: ButtonBase.isPrimary() |
setReset | public void setReset(boolean reset)(Code) | | Indicates that the button should be a HTML reset button. By default,
this value is false and the button is created as a submit button. If the
value is set to true, no action listener will be invoked.
See Also: ButtonBase.isReset() |
setTabIndex | public void setTabIndex(int tabIndex)(Code) | | The position of this component in the tabbing order sequence
See Also: ButtonBase.getTabIndex() |
setText | public void setText(Object text)(Code) | | Textual label used to create the visual appearance of this button.
Either the "imageURL" or "text" attributes must be specified. When a
text value is given, the standard button image is used, with the
specified text displayed on the button.
See Also: ButtonBase.getText() |
setValueBinding | public void setValueBinding(String name, ValueBinding binding)(Code) | | Set the ValueBinding stored for the
specified name (if any), respecting any property
aliases.
Parameters: name - Name of value binding to set Parameters: binding - ValueBinding to set, or null to remove |
setVisible | public void setVisible(boolean visible)(Code) | | Use the visible attribute to indicate whether the component should be
viewable by the user in the rendered HTML page. If set to false, the
HTML code for the component is present in the page, but the component
is hidden with style attributes. By default, visible is set to true, so
HTML for the component HTML is included and visible to the user. If the
component is not visible, it can still be processed on subsequent form
submissions because the HTML is present.
See Also: ButtonBase.isVisible() |
|
|