xajaxRequest. inc.php

Contains the xajaxRequest class

Summary
Contains the xajaxRequest class
Please see copyright.inc.php for a detailed description, copyright and license information.
Specifies that the parameter will consist of an array of form values.
Specifies that the parameter will contain the value of an input control.
Specifies that the parameter will consist of a boolean value of a checkbox.
Specifies that the parameter value will be the innerHTML value of the element.
Specifies that the parameter will be a quoted value (string).
Specifies that the parameter will be a non-quoted value (evaluated by the browsers javascript engine at run time.
Used to store and generate the client script necessary to invoke a xajax request from the browser to the server script.
The name of the function.
A string containing either a single or a double quote character that will be used during the generation of the javascript for this function.
An array of parameters that will be used to populate the argument list for this function when the javascript is output in xajaxRequest->printScript
Construct and initialize this request.
Call this to instruct the request to use single quotes when generating the javascript.
Call this to instruct the request to use double quotes while generating the javascript.
Clears the parameter list associated with this request.
Adds a parameter value to the parameter list for this request.
Sets a specific parameter value.
Returns a string representation of the script output (javascript) from this request object.
Generates a block of javascript code that can be used to invoke the specified xajax request.
This class extends the xajaxRequest class such that simple javascript can be put in place of a xajax request to the server.
Constructs and initializes an instance of the object.
Clears the array of variables that will be used to modify the script before it is printed and sent to the client.
Sets a value that will be used to modify the script before it is sent to the browser.

xajaxRequest class

Please see copyright.inc.php for a detailed description, copyright and license information.

Summary
Specifies that the parameter will consist of an array of form values.
Specifies that the parameter will contain the value of an input control.
Specifies that the parameter will consist of a boolean value of a checkbox.
Specifies that the parameter value will be the innerHTML value of the element.
Specifies that the parameter will be a quoted value (string).
Specifies that the parameter will be a non-quoted value (evaluated by the browsers javascript engine at run time.

Constants

XAJAX_FORM_VALUES

Specifies that the parameter will consist of an array of form values.

XAJAX_INPUT_VALUE

Specifies that the parameter will contain the value of an input control.

XAJAX_CHECKED_VALUE

Specifies that the parameter will consist of a boolean value of a checkbox.

XAJAX_ELEMENT_INNERHTML

Specifies that the parameter value will be the innerHTML value of the element.

XAJAX_QUOTED_VALUE

Specifies that the parameter will be a quoted value (string).

XAJAX_JS_VALUE

Specifies that the parameter will be a non-quoted value (evaluated by the browsers javascript engine at run time.

xajaxRequest

Used to store and generate the client script necessary to invoke a xajax request from the browser to the server script.

This object is typically generated by the xajax->register method and can be used to quickly generate the javascript that is used to initiate a xajax request to the registered function, object, event or other xajax call.

Summary
The name of the function.
A string containing either a single or a double quote character that will be used during the generation of the javascript for this function.
An array of parameters that will be used to populate the argument list for this function when the javascript is output in xajaxRequest->printScript
Construct and initialize this request.
Call this to instruct the request to use single quotes when generating the javascript.
Call this to instruct the request to use double quotes while generating the javascript.
Clears the parameter list associated with this request.
Adds a parameter value to the parameter list for this request.
Sets a specific parameter value.
Returns a string representation of the script output (javascript) from this request object.
Generates a block of javascript code that can be used to invoke the specified xajax request.

Variables

sName

var $sName

The name of the function.

sQuoteCharacter

var $sQuoteCharacter

A string containing either a single or a double quote character that will be used during the generation of the javascript for this function.  This can be set prior to calling xajaxRequest->printScript

aParameters

var $aParameters

An array of parameters that will be used to populate the argument list for this function when the javascript is output in xajaxRequest->printScript

Functions

xajaxRequest

function xajaxRequest($sName)

Construct and initialize this request.

sName(string): The name of this request.

useSingleQuote

function useSingleQuote()

Call this to instruct the request to use single quotes when generating the javascript.

useDoubleQuote

function useDoubleQuote()

Call this to instruct the request to use double quotes while generating the javascript.

clearParameters

function clearParameters()

Clears the parameter list associated with this request.

addParameter

function addParameter()

Adds a parameter value to the parameter list for this request.

sType(string): The type of the value to be used.
sValue(string: The value to be used.

See xajaxRequest->setParameter for details.

setParameter

function setParameter()

Sets a specific parameter value.

nParameter(number): The index of the parameter to set
sType(string): The type of value
sValue(string): The value as it relates to the specified type

Types should be one of the following XAJAX_FORM_VALUES, XAJAX_QUOTED_VALUE, XAJAX_JS_VALUE, XAJAX_INPUT_VALUE, XAJAX_CHECKED_VALUE.  The value should be as follows: XAJAX_FORM_VALUES - Use the ID of the form you want to process.  XAJAX_QUOTED_VALUE - The string data to be passed.  XAJAX_JS_VALUE - A string containing valid javascript (either a javascript variable name that will be in scope at the time of the call or a javascript function call whose return value will become the parameter.

TODO: finish documenting the options.

getScript

function getScript()

Returns a string representation of the script output (javascript) from this request object.  See also: xajaxRequest::printScript

printScript

function printScript()

Generates a block of javascript code that can be used to invoke the specified xajax request.

xajaxCustomRequest

This class extends the xajaxRequest class such that simple javascript can be put in place of a xajax request to the server.  The primary purpose of this class is to provide simple scripting services to the xajaxControl based objects, like <clsInput>, clsTable and <clsButton>.

Summary
Constructs and initializes an instance of the object.
Clears the array of variables that will be used to modify the script before it is printed and sent to the client.
Sets a value that will be used to modify the script before it is sent to the browser.

Variables

aVariables;

sScript;

Functions

xajaxCustomRequest

function xajaxCustomRequest($sScript)

Constructs and initializes an instance of the object.

sScript(string): The javascript (template) that will be printed upon request.
aVariables(associative array, optional): An array of variable name, value pairs that will be passed to xajaxCustomRequest->setVariable

clearVariables

function clearVariables()

Clears the array of variables that will be used to modify the script before it is printed and sent to the client.

setVariable

function setVariable($sName,
$sValue)

Sets a value that will be used to modify the script before it is sent to the browser.  The xajaxCustomRequest object will perform a string replace operation on each of the values set with this function.

printScript

function printScript()
This file contains detailed information regarding the xajax project, current version, copyrights, licnese and documentation.
var $sName
The name of the function.
var $sQuoteCharacter
A string containing either a single or a double quote character that will be used during the generation of the javascript for this function.
var $aParameters
An array of parameters that will be used to populate the argument list for this function when the javascript is output in xajaxRequest->printScript
function printScript()
Generates a block of javascript code that can be used to invoke the specified xajax request.
function xajaxRequest($sName)
Construct and initialize this request.
function useSingleQuote()
Call this to instruct the request to use single quotes when generating the javascript.
function useDoubleQuote()
Call this to instruct the request to use double quotes while generating the javascript.
function clearParameters()
Clears the parameter list associated with this request.
function addParameter()
Adds a parameter value to the parameter list for this request.
function setParameter()
Sets a specific parameter value.
function getScript()
Returns a string representation of the script output (javascript) from this request object.
Used to store and generate the client script necessary to invoke a xajax request from the browser to the server script.
function xajaxCustomRequest($sScript)
Constructs and initializes an instance of the object.
function clearVariables()
Clears the array of variables that will be used to modify the script before it is printed and sent to the client.
function setVariable($sName,
$sValue)
Sets a value that will be used to modify the script before it is sent to the browser.
function printScript()
function register($sType,
$mArg)
Call this function to register request handlers, including functions, callable objects and events.
Specifies that the parameter will consist of an array of form values.
Specifies that the parameter will be a quoted value (string).
Specifies that the parameter will be a non-quoted value (evaluated by the browsers javascript engine at run time.
Specifies that the parameter will contain the value of an input control.
Specifies that the parameter will consist of a boolean value of a checkbox.
The base class for all xajax enabled controls.
A xajaxControlContainer derived class that aids in the construction of HTML tables.