Maps API for JavaScript Developer's Guide

H.ui.base.Button

Class Summary

Extends: H.ui.base.Element

This class represents a button.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

getState () : {H.ui.base.Button.State}

This method returns the current state of the button.

setState (state, opt_suppressEvent) : {H.ui.base.Button}

This method sets the state of this button.

getLabel () : {string}

This method returns the label string of this button.

setLabel (label, opt_force) : {H.ui.base.Button}

This method sets the label string of this button.

addEventListener (type, handler, opt_capture, opt_scope)

This method allows to listen for specific event triggered by the object

removeEventListener (type, handler, opt_capture, opt_scope)

This method will removed previously added listener from the event target

renderInternal (element, doc)

This method is the concrete implementation of the UI element. This method receives the pre-rendered HTML element which may be modified by deriving classes.

isDisabled () : {boolean}

This method returns this UI element's disabled state as a boolean value.

setDisabled (disabled, opt_force) : {H.ui.base.Element}

This method set's the disabled state of this UI element.

getData () : {*}

This method returns a previously stored arbitrary data from this element.

setData (data)

This method stores arbitrary data with this UI element.

getElement () : {?HTMLElement}

This method returns the HTML element this UI element renders.

setVisibility (visibility)

Sets the visibility of this element.

getVisibility () : {boolean}

Returns the visibility of this element.

addClass (className) : {H.ui.base.Element}

This method adds a CSS class to this UI element (if it is not already present).

removeClass (className) : {H.ui.base.Element}

This method removes a CSS class from this UI element (if it is present).

Events Summary

Table 2. Events
Events

statechange : {H.util.Event}

This event is dispatched by the button when it's state changes.

Class Description

This class represents a button.

Constructor Details

H.ui.base.Button(opt_options)

Parameters:
 
opt_options:
{H.ui.base.Button.Options=} [optional]
 
optional parameters to be passed to the button instance

Method Details

getState () : {H.ui.base.Button.State}

This method returns the current state of the button.

Returns:
 
{H.ui.base.Button.State}
the current state of the button

setState (state, opt_suppressEvent) : {H.ui.base.Button}

This method sets the state of this button.

Parameters:
 
state:
{H.ui.base.Button.State}
 
the state to which this button is to be set
opt_suppressEvent:
{boolean=} [optional]
 
an optional flag indicating that the onStateChange callback is not to be invoked
Returns:
 
{H.ui.base.Button}
this button instance

getLabel () : {string}

This method returns the label string of this button.

Returns:
 
{string}
the label string of this button

setLabel (label, opt_force) : {H.ui.base.Button}

This method sets the label string of this button.

Parameters:
 
label:
{string}
 
the label to set on this button
opt_force:
{boolean=} [optional]
 
a boolean flag indicating that the new label should be set and propagated even if it has the same value as the current one.
Returns:
 
{H.ui.base.Button}
this button instance

addEventListener (type, handler, opt_capture, opt_scope)

This method allows to listen for specific event triggered by the object

Parameters:
 
type:
{string}
 
name of event
handler:
{!Function}
 
event handler function
opt_capture:
{boolean=} [optional]
 
if set to true will listen in the capture phase (bubble otherwise)
opt_scope:
{Object=} [optional]
 
scope for the handler function

removeEventListener (type, handler, opt_capture, opt_scope)

This method will removed previously added listener from the event target

Parameters:
 
type:
{string}
 
name of event
handler:
{!Function}
 
previously added event handler
opt_capture:
{boolean=} [optional]
 
if set to true will listen in the capture phase (bubble otherwise)
opt_scope:
{Object=} [optional]
 
scope for the handler function

renderInternal (element, doc)

This method is the concrete implementation of the UI element. This method receives the pre-rendered HTML element which may be modified by deriving classes.

Parameters:
 
element:
{Element}
 
this UI element's HTML representation
doc:
{Document}
 
the HTML document into which the element is currently being rendered

isDisabled () : {boolean}

This method returns this UI element's disabled state as a boolean value.

Returns:
 
{boolean}
true if the element is disabled, false otherwise

setDisabled (disabled, opt_force) : {H.ui.base.Element}

This method set's the disabled state of this UI element.

Parameters:
 
disabled:
{boolean}
 
true to disabled the element, false to enabled it
opt_force:
{boolean=} [optional]
 
an optional boolean flag indicating that the value should be set and propagated even if it is the same as the current state
Returns:
 
{H.ui.base.Element}
this element instance

getData () : {*}

This method returns a previously stored arbitrary data from this element.

Returns:
 
{*}
the previously stored data object or null if not data was stored.

setData (data)

This method stores arbitrary data with this UI element.

Parameters:
 
data:
{*}
 
the data to be stored

getElement () : {?HTMLElement}

This method returns the HTML element this UI element renders.

Note: Before the UI element was rendered the method returns null.

Returns:
 
{?HTMLElement}
the element

setVisibility (visibility)

Sets the visibility of this element.

Parameters:
 
visibility:
{boolean}
 

getVisibility () : {boolean}

Returns the visibility of this element.

Returns:
 
{boolean}
visibility

addClass (className) : {H.ui.base.Element}

This method adds a CSS class to this UI element (if it is not already present).

Parameters:
 
className:
{string}
 
the CSS class name to add
Returns:
 
{H.ui.base.Element}
this UI element instance

removeClass (className) : {H.ui.base.Element}

This method removes a CSS class from this UI element (if it is present).

Parameters:
 
className:
{string}
 
the CSS class name to add
Returns:
 
{H.ui.base.Element}
this UI element instance

Event Details

statechange: {H.util.Event}

This event is dispatched by the button when it's state changes.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.