Alloy UI

aui-io  1.0.1

 
Filters

Class IORequest - extends Plugin.Base - uses io

Known Subclasses:
A.Plugin.IO
A base class for IORequest, providing:
  • Response data normalization for XML, JSON, JavaScript
  • Cache options
Quick Example:
A.io.request(uri, config);
Check the list of Configuration Attributes available for IORequest.

Constructor

IORequest ( config )
Parameters:
config <Object> Object literal specifying widget configuration properties.

Properties

IORequest.ATTRS - static Object

Static property used to define the default attribute configuration for the IORequest.

IORequest.NAME - static String

Static property provides a string to identify the class.

Properties inherited from Attribute:

Properties inherited from Base:

Properties inherited from Plugin.Base:

Properties inherited from io:

Configuration Attributes

active - boolean

Whether the transaction is active or not.
Default Value: false

arguments - Object

Default Value: Value mapped on YUI.AUI.defaults.io.

autoLoad - boolean

If true invoke the start method automatically, initializing the IO transaction.
Default Value: true

cache - boolean

If false the current timestamp will be appended to the url, avoiding the url to be cached.
Default Value: true

cfg - String

Object containing all the IO Configuration Attributes. This Object is passed to the A.io internally.
Default Value: Object containing all the IO Configuration Attributes.

context - Object

Default Value: Value mapped on YUI.AUI.defaults.io.

data - Object

Default Value: Value mapped on YUI.AUI.defaults.io.

dataType - String

The type of the request (i.e., could be xml, json, javascript, text).
Default Value: null

form - Object

Default Value: Value mapped on YUI.AUI.defaults.io.

headers - Object

Set the correct ACCEPT header based on the dataType.
Default Value: Object

method - String

Default Value: Value mapped on YUI.AUI.defaults.io.

responseData - String | JSONObject | XMLDocument

This is a normalized attribute for the response data. It's useful to retrieve the correct type for the dataType (i.e., in json requests the responseData) is a JSONObject.
Default Value: null

sync - boolean

Default Value: Value mapped on YUI.AUI.defaults.io.

timeout - Number

Default Value: Value mapped on YUI.AUI.defaults.io.

transaction - Object

Stores the IO Object of the current transaction.
Default Value: null

uri - String

URI to be requested using AJAX.
Default Value: null

xdr - Object

Default Value: Value mapped on YUI.AUI.defaults.io.

Configuration attributes inherited from Base:

Configuration attributes inherited from Plugin.Base:

Methods

_autoStart

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

_end

protected void _end ( id )
Internal end callback for the IO transaction.
Parameters:
id <Number> ID of the IO transaction.

_parseURL

protected String _parseURL ( url )
Parse the uri to add a timestamp if cache is true. Also applies the YUI.AUI.defaults.io.uriFormatter.
Parameters:
url <String>

_setIOData

protected String _setIOData ( value )
Applies the YUI.AUI.defaults.io.dataFormatter if defined.
Parameters:
value <Object>

_setResponseData

protected Object _setResponseData ( xhr )
Setter for responseData.
Parameters:
xhr <Object> XHR Object.

_success

protected void _success ( id , obj )
Internal success callback for the IO transaction.
Parameters:
id <Number> ID of the IO transaction.
obj <Object> IO transaction Object.

destructor

protected void destructor ( )
Descructor lifecycle implementation for the IORequest class. Purges events attached to the node (and all child nodes).

initializer

protected void initializer ( )
Construction logic executed during IORequest instantiation. Lifecycle.

start

void start ( )
Starts the IO transaction. Used to refresh the content also.

stop

void stop ( )
Stops the IO transaction.

Events

activeChange

activeChange ( event )
Fires when the value for the configuration attribute 'active' 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

argumentsChange

argumentsChange ( event )
Fires when the value for the configuration attribute 'arguments' 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

autoLoadChange

autoLoadChange ( event )
Fires when the value for the configuration attribute 'autoLoad' 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

cacheChange

cacheChange ( event )
Fires when the value for the configuration attribute 'cache' 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

cfgChange

cfgChange ( event )
Fires when the value for the configuration attribute 'cfg' 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

contextChange

contextChange ( event )
Fires when the value for the configuration attribute 'context' 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

dataChange

dataChange ( event )
Fires when the value for the configuration attribute 'data' 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

dataTypeChange

dataTypeChange ( event )
Fires when the value for the configuration attribute 'dataType' 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

formChange

formChange ( event )
Fires when the value for the configuration attribute 'form' 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

headersChange

headersChange ( event )
Fires when the value for the configuration attribute 'headers' 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

methodChange

methodChange ( event )
Fires when the value for the configuration attribute 'method' 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

responseDataChange

responseDataChange ( event )
Fires when the value for the configuration attribute 'responseData' 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

syncChange

syncChange ( event )
Fires when the value for the configuration attribute 'sync' 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

timeoutChange

timeoutChange ( event )
Fires when the value for the configuration attribute 'timeout' 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

transactionChange

transactionChange ( event )
Fires when the value for the configuration attribute 'transaction' 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

uriChange

uriChange ( event )
Fires when the value for the configuration attribute 'uri' 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

xdrChange

xdrChange ( event )
Fires when the value for the configuration attribute 'xdr' 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

Events inherited from Base:

Events inherited from Plugin.Base: