Skip to content

Instantly share code, notes, and snippets.

@novoj
Created October 2, 2013 11:44
Show Gist options
  • Save novoj/6792461 to your computer and use it in GitHub Desktop.
Save novoj/6792461 to your computer and use it in GitHub Desktop.
/**
* Partial update allows AJAX partial update of the DOM structure by communicating with component background implemented
* in RamJet technology.
*
* Custom settings:
*
* alterHistory - boolean true - if browser history is ought to be altered,
* - boolean false - if browser history should remain untouched
* - (default) not set - only links/forms targeting the same page will alter the history
* historyScope - parameters - keeps only parameter values in history
* - (default) allData - default (keeps parameters and all widget values in history - please consider this preset
* when working with private data, such as passwords)
* clearCache - boolean true - remembered results are purged before executing call
* - (default) otherwise - nothing
* htmlContainer - id of the HTML container to be replaces with returned content (if not set
* it equals containerId passed in the method call)
* suppressRedirect- boolean true - suppresses full page redirect even if server returns 302 (Moved Temporarily) and performs
* partial update with the result returned from page servers redirects to (when target page contains
* no component required for partial update, content of the update area will get removed!)
* - (default) boolean false - whenever servers responds with 302 (Moved Temporarily) client performs
* full page refresh
* suppressSubmitEvent - boolean true - when executing function executeSubmit submit event on form DOM element will not be triggered
* - (default) boolean false - executing this function will trigger the event
* encrypt - boolean true - if set all parameters will be encrypted with jCryption library when another two
* prerequisities are fulfilled
* a) another JS file /jCryption/jquery.jcryption.js is linked on the page
* b) jCryption servlet filter is configured in the web application
* [note: encryption cannot be used for forms with file inputs = ie. binary data]
* - (default) boolean false
*
* Events:
*
* beforeContentsReplaced - before contents of the container are replaced, if method sets false to settings.stopReplacement
* replacement logic will be stopped
* afterContentsReplaced - after contents of the container are replaced
* encryptionInitiated - before encryption process starts
* encryptionKeysAcquired - after public key is obtained from the server and before form contents encryption starts
* encryptionProcessed - after encryption is finished and before ajax call really starts
*
* @author Jan Novotny
* @version 1.0
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment