Alloy UI

aui-io  1.0.1

 
Filters

Class A.Plugin.IO - extends IORequest

A base class for IOPlugin, providing:
  • Loads the content of a URI as content of a Node or Widget
  • Use ParseContent to parse the JavaScript tags from the content and evaluate them
Quick Example:
A.one('#content').plug(A.Plugin.IO, { uri: 'assets/content.html', method: 'GET' });
Check the list of Configuration Attributes available for IOPlugin.

Constructor

A.Plugin.IO ( config )
Parameters:
config <Object> Object literal specifying widget configuration properties.

Properties

A.Plugin.IO.ATTRS - static Object

Static property used to define the default attribute configuration for the A.Plugin.IO.

A.Plugin.IO.NAME - static String

Static property provides a string to identify the class.

A.Plugin.IO.NS - static String

Static property provides a string to identify the namespace.

Properties inherited from io:

Properties inherited from Attribute:

Properties inherited from Base:

Properties inherited from Plugin.Base:

Properties inherited from IORequest:

Configuration Attributes

failureMessage - String

Message to be set on the content when the transaction fails.
Default Value: 'Failed to retrieve content'

loadingMask - Object

Options passed to the LoadingMask.
Default Value: {}

node - Node | String

Plug IO in any object we want, the setContent will use the node to set the content.
Default Value: null

parseContent - boolean

If true the ParseContent plugin will be plugged to the node.
Default Value: true

section - String

Section where the content will be set in case you are plugging it on a instace of WidgetStdMod.
Default Value: StdMod.BODY

showLoading - boolean

Show the LoadingMask covering the node while loading.
Default Value: true

type - String

Type of the instance we are pluggin the A.Plugin.IO. Could be a Node, or a Widget.
Default Value: 'Node'

where - String

Where to insert the content, AFTER, BEFORE or REPLACE.
Default Value: StdMod.REPLACE

Configuration attributes inherited from Base:

Configuration attributes inherited from Plugin.Base:

Methods

_autoStart

protected void _autoStart ( )
Invoke the start method (autoLoad attribute).

_bindParseContent

protected void _bindParseContent ( )
Bind the ParseContent plugin on the instance.

_failureHandler

protected void _failureHandler ( event , id , obj )
Internal failure callback for the IO transaction.
Parameters:
event <EventFavade>
id <String> Id of the IO transaction.
obj <Object> XHR transaction Object.

_getContentSetterByType

protected function _getContentSetterByType ( )
Get the appropriated setContent function implementation for each type.

_onActiveChange

protected void _onActiveChange ( event )
Fires after the value of the active attribute change.
Parameters:
event <EventFacade>

_setLoadingUI

protected void _setLoadingUI ( show )
Whether the show is true show the LoadingMask.
Parameters:
show <boolean>

_successHandler

protected void _successHandler ( event , id , obj )
Internal success callback for the IO transaction.
Parameters:
event <EventFavade>
id <String> Id of the IO transaction.
obj <Object> XHR transaction Object.

_syncLoadingMaskUI

protected void _syncLoadingMaskUI ( )
Sync the loading mask UI.

bindUI

protected void bindUI ( )
Bind the events on the A.Plugin.IO UI. Lifecycle.

hideLoading

void hideLoading ( )
Invoke the OverlayMask hide method.

setContent

void setContent ( )
Set the content of the node.

showLoading

void showLoading ( )
Invoke the OverlayMask show method.

start

void start ( )
Overload to the IORequest start method. Check if the host is already rendered, otherwise wait to after render phase and to show the LoadingMask.

Methods inherited from Plugin.Host:

Methods inherited from io:

Events

failureMessageChange

failureMessageChange ( event )
Fires when the value for the configuration attribute 'failureMessage' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

loadingMaskChange

loadingMaskChange ( event )
Fires when the value for the configuration attribute 'loadingMask' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

nodeChange

nodeChange ( event )
Fires when the value for the configuration attribute 'node' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

parseContentChange

parseContentChange ( event )
Fires when the value for the configuration attribute 'parseContent' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

sectionChange

sectionChange ( event )
Fires when the value for the configuration attribute 'section' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

showLoadingChange

showLoadingChange ( event )
Fires when the value for the configuration attribute 'showLoading' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

typeChange

typeChange ( event )
Fires when the value for the configuration attribute 'type' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

whereChange

whereChange ( event )
Fires when the value for the configuration attribute 'where' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set