tapestry

Provides the core functionality for the Tapestry javascript package libraries.

Most of the functions in here are related to initiating and parsing IO requests.

Summary
tapestryProvides the core functionality for the Tapestry javascript package libraries.
Properties
versionThe current client side library version, usually matching the current java library version.
Functions
bindCore XHR bind function for tapestry internals.
errorGlobal error handling function for dojo.io.bind requests.
loadGlobal load handling function for dojo.io.bind requests.
loadContentUsed by tapestry.load when handling xml responses to iterate over the tapestry specific xml response and appropriately load all content types / perform animations / execute scripts in the proper order / etc..
loadScriptContentManages loading javascript content for a specific incoming xml element.
loadScriptFromUrlTakes a url string and loads the javascript it points to as a normal document head script include section.
presentExceptionWhen remote exceptions are caught on the server special xml blocks are returned to the client when the requests are initiated via async IO.
cleanConnectUtility used to disconnect a previously connected event/function.

Properties

version

The current client side library version, usually matching the current java library version.  (ie 4.1, etc..)

Functions

bind

bind:function(url,
content,
json)

Core XHR bind function for tapestry internals.  The error/load functions defined in this package are used to handle load/error of dojo.io.bind.

Parameters

urlThe url to bind the request to.
contentA properties map of optional extra content to send.
jsonBoolean, optional parameter specifying whether or not to create a json request.  If not specified the default is to use XHR.

error

error:function(type,
exception,
http,
kwArgs)

Global error handling function for dojo.io.bind requests.  This function is mapped as the “error:functionName” part of a request in the dojo.io.bind arguments in tapestry.bind calls.

See Also

tapestry.bind

load

load:function(type,
data,
http,
kwArgs)

Global load handling function for dojo.io.bind requests.  This isn’t typically called directly by anything, but passed in as the “load” argument to dojo.io.bind when making IO requests as the function that will handle the return response.

Parameters

typeType of request.
dataThe data returned, depending on the request type might be an xml document / plaintext / json / etc.
httpThe http object used in request, like XmlHttpRequest.
kwArgsThe original set of arguments passed into dojo.io.bind({arg:val,arg1:val2}).

loadContent

loadContent:function(id,
node,
element)

Used by tapestry.load when handling xml responses to iterate over the tapestry specific xml response and appropriately load all content types / perform animations / execute scripts in the proper order / etc..

Parameters

idThe element id that this content should be applied to in the existing document.
nodeThe node that this new content will be applied to.
elementThe incoming xml node containing rules/content to apply to this node.

loadScriptContent

loadScriptContent:function(element,
async)

Manages loading javascript content for a specific incoming xml element.

Parameters

elementThe element to parse javascript statements from and execute.
asyncWhether or not to process the script content asynchronously, meaning whether or not to execute the script in a block done in a setTimeout call so as to avoid IE specific issues.

loadScriptFromUrl

loadScriptFromUrl:function(url)

Takes a url string and loads the javascript it points to as a normal document head script include section. ie:

<script type="text/javascript" src="http://localhost/js/foo.js"></script>

Parameters

urlThe url to the script to load into this documents head.

presentException

presentException:function(node,
kwArgs)

When remote exceptions are caught on the server special xml blocks are returned to the client when the requests are initiated via async IO.  This function takes the incoming Tapestry exception page content and dumps it into a modal dialog that is presented to the user.

Parameters

nodeThe incoming xml exception node.
kwArgsThe kwArfs used to initiate the original IO request.

cleanConnect

cleanConnect:function(target,
event,
funcName)

Utility used to disconnect a previously connected event/function.

This assumes that the incoming function name is being attached to the global namespace “tapestry”.

bind:function(url,
content,
json)
Core XHR bind function for tapestry internals.
error:function(type,
exception,
http,
kwArgs)
Global error handling function for dojo.io.bind requests.
load:function(type,
data,
http,
kwArgs)
Global load handling function for dojo.io.bind requests.
loadContent:function(id,
node,
element)
Used by <tapestry.load> when handling xml responses to iterate over the tapestry specific xml response and appropriately load all content types / perform animations / execute scripts in the proper order / etc..
loadScriptContent:function(element,
async)
Manages loading javascript content for a specific incoming xml element.
loadScriptFromUrl:function(url)
Takes a url string and loads the javascript it points to as a normal document head script include section.
presentException:function(node,
kwArgs)
When remote exceptions are caught on the server special xml blocks are returned to the client when the requests are initiated via async IO.
cleanConnect:function(target,
event,
funcName)
Utility used to disconnect a previously connected event/function.