Show TOC

Background documentationTool Bar Button Locate this document in the navigation structure

 

Provides any type of functionality in your application at the touch of the button. Hints can be displayed as the mouse cursor passes over the button, or as the mouse button is pressed but not released. The toolbar button has to be used together with the "toolbar" control.

  • enabled

    A boolean value that defines if the toolbar button is clickable. If the toolbar button is disabled (enabled="FALSE") it sends no event when you press a mouse button on the toolbar button. A disabled toolbar button has a different text color to show the user that it is disabled.

  • id

    Identification name of the toolbar button.

  • onClick

    Defines the event handling method that will be processed when the user clicks on the enabled button. If you do not define an 'onClick' event the button can be clicked but no event is generated.

  • onClientClick

    Defines the JavaScript fragment that is executed when the user clicks on the button. If both events ('onClick' and 'onClientClick') are specified, the 'onClientClick' event handling method is activated first. By default the 'onClick' event handling method is activated afterwards. In the JavaScript fragment you can cancel the activation of the 'onClick' event handling method with the command htmlbevent.cancelSubmit=true;

    The 'onClientClick' event is useful to pre-process the form and only send the form to client if the pre-processing was successful (for example, date validation, valid number format and so on) to save client/server interaction.

    Example Example

    A button click usually activates the client/server interaction. If an input field has to be filled out for further processing, the JavaScript fragment can check the necessary input on the client side and display a message if the necessary input is missing, without server interaction.

    End of the example.

    Note Note

    To use JavaScript the JSP has to use the page tag (set page tag).

    End of the note.
  • text

    Defines the string of text placed centered on the button. If no text should be displayed in the button an empty string (null) can be used. The width of the button is automatically adjusted to the length of the text.

  • tooltip

    Defines the hint of the button which is displayed as the mouse cursor passes over the button, or as the mouse button is pressed but not released.

Attributes

M

Values

Usage

enabled

FALSE (d)

TRUE

Taglib

enabled="FALSE"

Classlib

setEnabled(false)

id

*

String (cs)

Taglib

id="OrderConfirm"

Classlib

setId("OrderConfirm")

text

String

Taglib

text="Confirm"

Classlib

setText("Confirm")

tooltip

String

Taglib

tooltip="Confirm order"

Classlib

setTooltip("Confirm order")

Events

M

Values

Usage

onClick

String (cs)

Taglib

onClick="ProcessConfirm"

Classlib

setOnClick("ProcessConfirm")

onClientClick

String (cs)

Taglib

onClientClick="alert('Confirm')"

Classlib

setOnClientClick("alert('Confirm')")

Example

using the taglib

Syntax Syntax

  1.   <hbj:toolbarButton id="OpenButton"
        text="Open"
        onClick="ProcessOpen"
      />
    
End of the code.

using the classlib

Syntax Syntax

  1.     ToolbarButton openButton = tb.addToolbarButton("OpenButton", "Open");
        openButton.setOnClick("ProcessOpen");
    
End of the code.
Result

The toolbar button has to be used in the toolbar control. See the "toolbar" control description for the result.