MAF.control.PromptButton

Displays a MAF.dialogs.Alert dialog with the options of this component when selected by a user.

new MAF.control.PromptButton()

Configs

message : {String}

Message used in the dialog.

title : {String}

Title used in the dialog.

Methods

animate(config) inherited

Parameters:

NameTypeDescription
configObject

A config object

Fires:

appendTo() → {Class} inherited

Appends this component to a parent.

Returns:

This component.

changeValue(callback, value) inherited

Calls the supplied callback method.

Parameters:

NameTypeDescription
callbackfunction

Method to return a new value to the component.

valueString

The current value of the component.

createContent() virtualinherited

After the component has appended to the view this method can be used to create some more content to be added to this component. This can be implemented (or overridden) by objects that inherit the member.

focus() inherited

This will try and focus this component. If it cannot recieve focus, this focus will stay on the currently focused component.

freeze() → {Class} inherited

Freezes this component. Screen renders no longer trigger until thawed.

Returns:

This component.

generateStatePacket() privateinherited

Gives a object containing values needed for keeping the state of this component between different views.

getAbsolutePosition() → {Object} inherited

Give back the position relative to its first positioned ancestor element

Returns:

{hOffset:Number, vOffset: Number}

getDisplayValue(value) → {String} inherited

Without supplying a parameter this will return the label corresponding with the current value of the button.

Parameters:

NameTypeArgumentDescription
valueStringoptional 

When supplied this will lookup label that belongs with it.

Returns:

Label

getOptionLabels() → {Array} inherited

Returns:

Stored option labels in this component.

getOptions() → {Array} inherited

Returns:

Stored options in this component as objects with value and label keys

getOptionValues() → {Array} inherited

Returns:

Stored option values in this component.

getText() inherited

Get which text is displayed on this component.

getValue() → {String} inherited

Get the value of component.

Returns:

The current value of the component or a empty string.

getView() → {Class} inherited

Returns:

Returns the view this class is appended on.

hide() → {Class} inherited

Hides this component.

Returns:

This component.

initialize() inherited

Initialize the class

inspectStatePacket() inherited

Handle the state of this component for example when returning on the view it is on.

setDisabled(disabled) inherited

Change the disabled state of the component. A disabled component will not be able to recieve focus.

If not changed in extended component it will also set opacity to 05 when disabled.

Parameters:

NameTypeArgumentDefaultDescription
disabledbooleanoptional false

True will disable the component, false will enable it.

setOptions(values, labels) inherited

Based on the incomming parameters this fills the components options.

Parameters:

NameTypeArgumentDescription
valuesArray

The array can be given in two ways:

  • An Array containing values.
  • An array containing objects with value and label keys:
labelsArrayoptional 

An array containing labels. When not supplied and the first parameter is an Array with values the labels will be the same as the values.

Example

inputbutton.setOptions([
   { label: 'Two', value: '2' },
   { label: 'Three', value: '3' }
]);

setSecure(secure) → {Class} inherited

Parameters:

NameTypeDescription
secureboolean

Returns:

This component.

setText(text) inherited

Set which text to display on this component.

Parameters:

NameTypeDescription
textString

The text

setValue(value) → {String} inherited

Set the value of the component.

Parameters:

NameTypeDescription
valueString

Value to be set.

Returns:

The current value of the component or a empty string.

show() → {Class} inherited

Shows this component.

Returns:

This component.

thaw() → {Class} inherited

Thawes this component. Screen renders can trigger again.

Returns:

This component.

toggleDisabled() → {Class} inherited

Toggle between the disable states of the component.

Returns:

This component.

toggleSecure() → {Class} inherited

Toggle between the secure states of the component.

Returns:

This component.

verifySecure() inherited

Events

onAnimationEnded

Fired when a animation on this component has ended.

onAppend

Fired when component has appended to a parent. Update visual appearances by applying a Theme style and rendering the skin.

onBlur

Fired when the component is blurred.

onFocus

Fired when the component recieves focus.

onNavigate

Fired when a navigation happens when the component has focus.

onOptionCancelled

Fired when the state packet indicates a cancel or no option was selected.

onOptionsChanged

Fired when options in the component have changed.

onOptionSelected

Fired when option is selected.

onSecureFailed

Fired when the component is secured and it fails to verify the security after a select.

onSelect

Fired when the component is selected.

onValueChanged

Fired by the setValue method when it changes.

onValueInitialized

Fired by the setValue method when it gets set for the first time.