Button

(part of package 'Bootstrap Components') Extends designtime/SolutionModel: JSWebComponent Extends runtime: RuntimeWebComponent

A simple button. It can contain text as well as (optionally) an icon before or after the text.

This is a reference page; many components have detailed usage guides here.

Properties

enabled

Whether the component is enabled or not; blocks onAction, onDoubleClick, onRightClick events. Type: Enabled Default Value: true


imageStyleClass

For buttons showing as plain text, you can also specify an image styleclass to be displayed to the left. Can be font awesome icons. Type: Styleclass


showAs

Option whether button text is shown as plain text, sanitized html or trusted html (as is). Type: String


styleClass

Button style class, typically one of the bootstrap button classes (e.g. 'btn btn-primary') Type: Styleclass Default Value: "btn btn-default"


tabSeq

Tab sequence index of the form Type: Tabseq


text

The text shown for the button (i18n is supported) Type: Tagstring


toolTipText

Tooltip text shown when hovering over the button (i18n is supported) Type: Tagstring


trailingImageStyleClass

An icon style class property (glyphicon, material design or Font Awesome). Example 'fas fa-search' If you want to use Font Awesome classes you need to enable the Font Awesome service from the Servoy Package Manager. Type: String


variant

Sets the variant of this button, this sets a certain set of styleclasses at runtime for which this variant is configured for Type: Variant


visible

Whether the button is visible or not Type: Visible


Events

onActionMethodID(event)

Fired when the button is clicked

Parameters:

  • {JSEvent} event The event object containing details about the click event (e.g., target element, mouse coordinates).


onDoubleClickMethodID(event)

Fired when the button is double clicked

Parameters:

  • {JSEvent} event * @param {JSEvent} event The event object containing details about the double-click event (e.g., target element, click timing).


onRightClickMethodID(event)

Fired when the button is right clicked

Parameters:

  • {JSEvent} event The event object containing details about the right-click event (e.g., target element, context menu trigger).


API

requestFocus()

Set the focus to this button.

Example:

myElement.requestFocus();


Last updated

Was this helpful?