client Function Namespace APE.Request.stack

Summary

File
<./src/Ape_Jsf/Source/Request/Request.Stack.js>

stack Function Namespace Detail

APE.Request.stack ()
Request.stack object.

These methods are very useful for example if your application must send different commands to APE server from several functions and you want to send them all at once.

File:
<./src/Ape_Jsf/Source/Request/Request.Stack.js>
See:

Summary

Own
Methods Attributes Methods Name Methods Description
<static>   APE.Request.stack. add (cmd, params, options) Add a command to request stack.
<static>   APE.Request.stack. send () Send the request stack.

<static> {void} APE.Request.stack. add (cmd, params, options)

Add a command to request stack.

Send the request stack.

Parameters:
{Array|string} cmd If the argument is a string, it should be a CMD (e.g. 'CONNECT'). If the argument is an array: the array should contain objects with cmd, params and sessid)
{object} params Optional The parameters that must be send with the command
{object} options Optional Object with request options
{boolean} options.sessid Optional Default: true Add the sessid property to the request
Returns:
{void} The request object
Example
//ape var is a reference to APE instance
//Add two request to the stack
ape.request.stack.add('testCommand', {"param1":"value"});
ape.request.stack.add('anotherCommand', {"param1":"value"});
//Send the stack to APE server
ape.request.stack.send();
See:

<static> {object} APE.Request.stack. send ()

Send the request stack.

This method send the command in the request stack added trough request.stack.add to the APE server.

Returns:
{object} The request object
Example
//ape var is a reference to APE instance
//Add two request to the stack
ape.request.stack.add('testCommand', {"param1":"value"});
ape.request.stack.add('anotherCommand', {"param1":"value"});
//Send the stack to APE server
ape.request.stack.send();
See: