IlvButton

IlvObject
  |
  +--IlvEmptyView
       |
       +--IlvButton
Category:
Common component
JavaScript File:
IlvButton.js
Description:
IlvButton is a DHTML button component that will call some JavaScript code or function when clicked. The button images are scaled to fit the button bounds specified in the constructor or by the setBounds method.

Constructor Summary
IlvButton(left, top, width, height, image, action)

Method Summary
childrenToHTML()
Creates the HTML for this component's children.
dispose()
Disposes of all resources being used by the button.
doClick()
This method is invoked when the user clicks the button.
getAction()
Returns the action to be triggered each time this button is pressed.
getCursor()
Returns the cursor of the button.
getHeight()
getImage()
Returns the image of the button.
getMessage()
Returns the message to be displayed when the mouse is over the button.
getMessagePanel()
Returns the message panel where the messages will be displayed.
getRolloverImage()
Returns the rollover image of the button.
getSelectedImage()
Returns the selected image of the button.
getToolTipText()
Returns the tooltip text of the button.
getWidth()
isEnabled()
Returns whether or not this button is enabled.
isSelected()
Indicates whether or not this button is selected.
isToggleButton()
Indicates whether or not this button is in toggle mode.
mouseDown(e)
This method is invoked when the mouse is pressed.
mouseOut(e)
This method is invoked when the mouse leaves the button.
mouseOver(e)
This method is invoked when the mouse is over the button.
mouseUp(e)
This method is invoked when the mouse is released.
setAction(action)
Sets the action to be triggered each time this button is pressed.
setChildrenBounds(left, top, width, height)
Changes the size of the button's child views.
setCursor(cursor)
Changes the cursor of the button.
setEnabled(enabled)
Sets whether or not this button is enabled.
setImage(image)
Sets the image of the button.
setMessage(message)
Sets the message to be displayed when the mouse is over the button.
setMessagePanel(ilvHTMLPanel)
Sets the message panel where the message will be displayed.
setRolloverImage(image)
Sets the rollover image of the button.
setSelected(selected)
Sets the button in selected mode.
setSelectedImage(image)
Sets the selected image of the button.
setToggleButton(set)
Sets or removes the toggle mode for the button.
setToolTipText(string)
Sets the tooltip text of the button.

Constructor Detail

IlvButton

IlvButton(left, top, width, height, image, action)
Creates an instance of IlvButton.

Method Detail

childrenToHTML

childrenToHTML()
Creates the HTML for this component's children. Warning: This method is considered to be part of an IlvButton's internal implementation and is not a public API.

dispose

dispose()
Disposes of all resources being used by the button. Make sure to call IlvObject.callDispose() function on the onunload event of the page:
  <body onunload="IlvObject.callDispose()">
 

doClick

doClick()
This method is invoked when the user clicks the button. It can be called directly to simulate a button click.

getAction

getAction()
Returns the action to be triggered each time this button is pressed.

getCursor

getCursor()
Returns the cursor of the button. The default value is "auto".

getHeight

getHeight()

getImage

getImage()
Returns the image of the button.

getMessage

getMessage()
Returns the message to be displayed when the mouse is over the button.

getMessagePanel

getMessagePanel()
Returns the message panel where the messages will be displayed.
Returns:
An instance of IlvHTMLPanel or null.

getRolloverImage

getRolloverImage()
Returns the rollover image of the button.

getSelectedImage

getSelectedImage()
Returns the selected image of the button.

getToolTipText

getToolTipText()
Returns the tooltip text of the button.

getWidth

getWidth()

isEnabled

isEnabled()
Returns whether or not this button is enabled.

Since:
JViews 8.0


isSelected

isSelected()
Indicates whether or not this button is selected.

isToggleButton

isToggleButton()
Indicates whether or not this button is in toggle mode.

mouseDown

mouseDown(e)
This method is invoked when the mouse is pressed.

mouseOut

mouseOut(e)
This method is invoked when the mouse leaves the button.

mouseOver

mouseOver(e)
This method is invoked when the mouse is over the button.

mouseUp

mouseUp(e)
This method is invoked when the mouse is released.

setAction

setAction(action)
Sets the action to be triggered each time this button is pressed.
Parameters:
action - A String representing a JavaScript code or a JavaScript function.

setChildrenBounds

setChildrenBounds(left, top, width, height)
Changes the size of the button's child views. Warning: This method is considered to be part of an IlvButton's internal implementation and is not a public API.
Parameters:
left - The absolute x position of the button on the page.
top - The absolute y position of the button on the page.
width - The width of the button.
height - The height of the button.

setCursor

setCursor(cursor)
Changes the cursor of the button.
Parameters:
cursor - The cursor name.

setEnabled

setEnabled(enabled)
Sets whether or not this button is enabled.
Parameters:
enabled - the enabled flag

Since:
JViews 8.0


setImage

setImage(image)
Sets the image of the button.
Parameters:
image - The URL of the image.

setMessage

setMessage(message)
Sets the message to be displayed when the mouse is over the button. The message is displayed in the status window of the browser and in the panel set using the setMessagePanel method.
Parameters:
message - The message.

setMessagePanel

setMessagePanel(ilvHTMLPanel)
Sets the message panel where the message will be displayed.
Parameters:
ilvHTMLPanel - An instance of IlvHTMLPanel.

setRolloverImage

setRolloverImage(image)
Sets the rollover image of the button.
Parameters:
image - The URL of the image.

setSelected

setSelected(selected)
Sets the button in selected mode.
Parameters:
selected - A Boolean value.

setSelectedImage

setSelectedImage(image)
Sets the selected image of the button.
Parameters:
image - The URL of the image.

setToggleButton

setToggleButton(set)
Sets or removes the toggle mode for the button.
Parameters:
selected - A Boolean value.

setToolTipText

setToolTipText(string)
Sets the tooltip text of the button.
Parameters:
string - A string.

Inherited Methods from IlvEmptyView
addSizeListener, childrenToHTML, getBounds, getHeight, getLeft, getLocation, getSize, getTop, getWidth, isStateInCookie, removeSizeListener, restoreState, saveState, setBounds, setChildrenBounds, setLocation, setSize, setStateInCookie, toHTML
Inherited Methods from IlvObject
callDispose, dispose, getClassName, hashCode, inherits, instanceOf, invoke, registerDispose, removeHTML, setClassName, superConstructor, superInvoke, toString, updateVisibility