Version 1 (modified by vaibhav, 16 months ago)

--

All of the nifty features of QCubed for making Ajax calls simpler as well as the ease of converting an Ajax call to a full page reload (or vice versa) by just changing the function calls depends on FormState. FormState, as is obvious by its name is the 'state' of the form (with QCubed, all your pages are simply 'forms').

The FormState contains all the information for all the elements contained on your page. The properties like 'Text' of the item, whether it was selected or not (in case of Radio / Checkboxes), its state of visibility and css classes assigned (only those which you set as properties while doing Form_Create and subsequent modifications in action event functions) and for all the other properties you can set for your elements with PHP code on your QForm.

FormStates can be managed using various FormStateHandlers in QCubed (read configuration.inc.php).

It is important that you do not expose all that information to an end user as he/she might be able to modify it. When using QFormStateHandler for managing FormStates, the FormState data must be encrypted (do install the mcrypt library) before being sent to the browser. Please refrain using yourself from using QFormStateHandler if you do not have the mcrypt library installed and working with PHP. This is not the case with QSessionFormStateHandler and QFileFormStateHandler as no FormState data is sent to the user's browser in that case. Also, QFormStateHandler increases the bandwidth requirements as it transfers a lot more data from client's browser to your server than other FormState handlers.

The available FormState Handlers are:

1. QFormStateHandler 2. QSessionFormStateHandler 3. QFileFormStateHandler