Provides the core functionality for the Tapestry javascript package libraries.
Most of the functions in here are related to initiating and parsing IO requests.
tapestry | Provides the core functionality for the Tapestry javascript package libraries. |
Properties | |
version | The current client side library version, usually matching the current java library version. |
requestEncoding | Defines the encoding that will be used in all Tapestry initiated XHR requests to encode URL or form data. |
Functions | |
bind | Core XHR bind function for tapestry internals. |
error | Global error handling function for dojo.io.bind requests. |
load | Global load handling function for dojo.io.bind requests. |
loadJson | |
loadContent | 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 | Manages loading javascript content for a specific incoming xml element. |
loadScriptFromUrl | Takes a url string and loads the javascript it points to as a normal document head script include section. |
presentException | 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 | Utility used to disconnect a previously connected event/function. |
isServingRequests | Utility used to find out if there are any ajax requests in progress. |
tapestry.html | Provides functionality related to parsing and rendering dom nodes. |
Functions | |
getContentAsString | Takes a dom node and returns its contents rendered in a string. |
getElementAsString | Takes a dom node and returns itself and its contents rendered in a string. |
tapestry. event | Utility functions that handle converting javascript event objects into a name/value pair format that can be sent to the remote server. |
Functions | |
buildEventProperties | Takes an incoming browser generated event (like key/mouse events) and creates a js object holding the basic values of the event in order for it to be submitted to the server. |
buildTargetProperties | Generic function to build a properties object populated with relevent target data. |
buildNodeProperties | Builds needed target node properties, like the node’s id. |
The current client side library version, usually matching the current java library version. (ie 4.1, etc..)
Defines the encoding that will be used in all Tapestry initiated XHR requests to encode URL or form data. Gets set by AjaxShellDelegate class on server on most requests by default.
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.
url | The url to bind the request to. |
content | A properties map of optional extra content to send. |
json | Boolean, optional parameter specifying whether or not to create a json request. If not specified the default is to use XHR. |
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.
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.
type | Type of request. |
data | The data returned, depending on the request type might be an xml document / plaintext / json / etc. |
http | The http object used in request, like XmlHttpRequest. |
kwArgs | The original set of arguments passed into dojo.io.bind({arg:val,arg1:val2}). |
loadJson:function( type, data, http, kwArgs )
Executed by default during JSON requests | default implementation does nothing but decrement the <tapestry.requestsInFlight> global variable. |
type | Type of request. |
data | The data returned, depending on the request type might be an xml document / plaintext / json / etc. |
http | The http object used in request, like XmlHttpRequest. |
kwArgs | The original set of arguments passed into dojo.io.bind({arg:val,arg1:val2}). |
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..
id | The element id that this content should be applied to in the existing document. |
node | The node that this new content will be applied to. |
element | The incoming xml node containing rules/content to apply to this node. |
loadScriptContent:function( element, async )
Manages loading javascript content for a specific incoming xml element.
element | The element to parse javascript statements from and execute. |
async | Whether 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: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>
url | The url to the script to load into this documents head. |
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.
node | The incoming xml exception node. |
kwArgs | The kwArgs used to initiate the original IO request. |
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”.
isServingRequests:function()
Utility used to find out if there are any ajax requests in progress.
Provides functionality related to parsing and rendering dom nodes.
Functions | |
getContentAsString | Takes a dom node and returns its contents rendered in a string. |
getElementAsString | Takes a dom node and returns itself and its contents rendered in a string. |
getContentAsString:function( node )
Takes a dom node and returns its contents rendered in a string.
The resulting string does NOT contain any markup (or attributes) of the given node - only child nodes are rendered and returned.Content
Implementation Note: This function tries to make use of browser specific features (the xml attribute of nodes in IE and the XMLSerializer object in Mozilla derivatives) - if those fails, a generic implementation is used that is guaranteed to work in all platforms.
node | The dom node. Returns: |
The string representation of the given node’s contents.
getElementAsString:function( node )
Takes a dom node and returns itself and its contents rendered in a string.
Implementation Note: This function uses a generic implementation in order to generate the returned string.
node | The dom node. Returns: |
The string representation of the given node.
Utility functions that handle converting javascript event objects into a name/value pair format that can be sent to the remote server.
Functions | |
buildEventProperties | Takes an incoming browser generated event (like key/mouse events) and creates a js object holding the basic values of the event in order for it to be submitted to the server. |
buildTargetProperties | Generic function to build a properties object populated with relevent target data. |
buildNodeProperties | Builds needed target node properties, like the node’s id. |
buildEventProperties:function( event, props )
Takes an incoming browser generated event (like key/mouse events) and creates a js object holding the basic values of the event in order for it to be submitted to the server.
event | The javascript event method is based on, if it isn’t a valid browser event it will be ignored. |
props | The existing property object to set the values on, if it doesn’t exist one will be created. Returns: |
The desired event properties bound to an object. Ie obj.target,obj.charCode, etc..
buildTargetProperties:function( props, target )
Generic function to build a properties object populated with relevent target data.
props | The object that event properties are being set on to return to the server. |
target | The javscript Event.target object that the original event was targeted for. |
The original props object passed in, populated with any data found.
Core XHR bind function for tapestry internals.
bind:function( url, content, json )
Global error handling function for dojo.io.bind requests.
error:function( type, exception, http, kwArgs )
Global load handling function for dojo.io.bind requests.
load:function( type, data, http, kwArgs )
loadJson:function( type, data, http, kwArgs )
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..
loadContent:function( id, node, element )
Manages loading javascript content for a specific incoming xml element.
loadScriptContent:function( element, async )
Takes a url string and loads the javascript it points to as a normal document head script include section.
loadScriptFromUrl:function( url )
When remote exceptions are caught on the server special xml blocks are returned to the client when the requests are initiated via async IO.
presentException:function( node, kwArgs )
Utility used to disconnect a previously connected event/function.
cleanConnect:function( target, event, funcName )
Utility used to find out if there are any ajax requests in progress.
isServingRequests:function()
Takes a dom node and returns its contents rendered in a string.
getContentAsString:function( node )
Takes a dom node and returns itself and its contents rendered in a string.
getElementAsString:function( node )
Takes an incoming browser generated event (like key/mouse events) and creates a js object holding the basic values of the event in order for it to be submitted to the server.
buildEventProperties:function( event, props )
Generic function to build a properties object populated with relevent target data.
buildTargetProperties:function( props, target )
Builds needed target node properties, like the node’s id.
buildNodeProperties:function( props, node )