Comments: on this page. Click to read or post your own.
This class collects all output that needs to be returned after an Form-Request to the client. It automatically determines if it needs to send back javascript after an Ajax-Request or just redirect to another page (on a normal request).
FormResponse is also responsible for keeping the client- and serverside in sync after an HTTP-Request by collecting javascript-commands (which mostly trigger subsequent update-calls by Ajax.) Use the output as a return-value for Ajax-based saving methods. Be sure to check if the call is acutally "ajaxy" by checking Director::is_ajax(). It is the developers responsibility to include this into his custom form-methods. Use the Request-Parameter 'htmlonly' to enforce a pure HTML-response from the client-side.
Example: A {@TableField} is in an incorrect state after being saved, as it still has rows marked as "new" which are already saved (and have an ID) in the database. By using AjaxSynchroniser we make sure that every instance is refreshed by Ajax and reflects the correct state.
Caution:
Located in /sapphire/core/control/FormResponse.php (line 30)
Status-messages are accumulated, and the "worst" is chosen
Add custom scripts.
Caution: Not escaped for backwards-compatibility.
Alias for status_message($messsage, 'bad')
Caution: Works only for forms which inherit methods from LeftAndMain.js
Get all content as a javascript-compatible string (only if there is an Ajax-Request present).
Falls back to {non_ajax_content}, {redirect_url} or Director::redirectBack() (in this order).
Set the title of a single page in the pagetree
Fallback-method to supply normal HTML-response when not being called by ajax.
Sets the status-message (overlay-notification in the CMS).
You can call this method multiple times, it will default to the "worst" statusmessage.
Replace a given DOM-element with the given content.
It automatically prefills {$non_ajax_content} with the passed content (as a fallback).
Update the status (upper right corner) of the given Form
Documentation generated on Sun, 19 Oct 2008 06:41:13 +1300 by phpDocumentor 1.3.2