Class PTHTTPPOSTRequest

Object
   |
   +--PTHTTPRequest
         |
         +--PTHTTPPOSTRequest

class PTHTTPPOSTRequest
extends PTHTTPRequest


Object wrapper for "in-place" client-server POST operations. Invoking a PTHTTPPOSTRequest will cause a background HTTP request to be sent to the server without reloading the contents of the browser. PTHTTPPOSTRequests can be set to automatically refresh the inner HTML of an element on the page, or to have the HTTP response that they generate be handled by a JavaScript function. All the form input values (with the exception of file inputs) will be transmitted in the PTHTTPPOSTRequest.

Usage:	
 	// refresh the content of an element
 	var myform = document.forms[0];
	var request = new PTHTTPPOSTRequest(myform.action, myform, document.getElementById('refresh-elem-id'));
	request.setRequestHeader('my-custom-header', 'headervalue');	
	request.invoke();
 
 OR
 	// invoke a response handling function
 	var myform = document.forms[0];
	function handleResponse(resp) { alert(resp.responseText); }	
	var request = new PTHTTPPOSTRequest(myform.action, myform, handleResponse);
	request.invoke();
 

Defined in PTHTTPPOSTRequest.js


Field Summary
<private>  Object className
          
 Object properties
          
<static>  <final> Object VERSION
          
   
Fields inherited from class PTHTTPRequest
url, type, callback, targetElement, responsePreProcHandler, responsePostProcHandler, concurrencyMode, requestHeaders, properties, _requestForm, formDataSet
 
Constructor Summary
PTHTTPPOSTRequest (url, formContent, responseHandler, concurrencyMode, properties)
            Creates a new "in-place" client-server POST request
 
Method Summary
 void setFormContent(formContent)
           Sets the form content for the request.
 void setPostBody(payload,contentType)
           Sets text for POST body
 void setPostBodyXML(xmlString)
           Set XML string as POST body
<static> <private>  Object _genSubmitFormHTMLFromForm(theForm, url)
           Generates the submit form html from a form.
<static> <private>  Object _genSubmitFormHTMLFromNVPairs(theArray, url)
           Generates the submit form html from an associative array of name/value pairs.
 
Methods inherited from class PTHTTPRequest
_setFormURLEncodedDataFromNVPairs, _setFormURLEncodedDataFromForm, setResponseHandler, setRequestHeader, invoke
 

Field Detail

className

<private> Object className

properties

Object properties

VERSION

<static> <final> Object VERSION

Constructor Detail

PTHTTPPOSTRequest

PTHTTPPOSTRequest(url, formContent, responseHandler, concurrencyMode, properties)

Method Detail

setFormContent

void setFormContent(formContent)

setPostBody

void setPostBody(payload,contentType)

setPostBodyXML

void setPostBodyXML(xmlString)

_genSubmitFormHTMLFromForm

<static>  <private> Object _genSubmitFormHTMLFromForm(theForm, url)

_genSubmitFormHTMLFromNVPairs

<static>  <private> Object _genSubmitFormHTMLFromNVPairs(theArray, url)


Documentation generated by JSDoc on Tue Sep 21 02:04:06 2010