Class QFormBase
- QBaseClass
- QFormBase
Direct known subclasses
QFormIndirect known subclasses
AjaxTimingForm, BasicForm, PluginManagerForm, ProjectListForm, RefreshForm, SampleForm, SpeedForm, TestImageBrowser, UrlForm, DataRepeaterExample, ExampleSingleForm, InjectForm, NestedTabForm, PaginatorForm, ParamsForm, PersistentExampleForm, PluginEditForm
public
integer|mixed|null|string
|
|
public
mixed|string
|
|
public
string
|
#
GenerateControlId( )
Generates Control ID used to keep track of those QControls whose ID was not explicitly set. It uses the counter variable to maintain uniqueness for Control IDs during the life of the page Life of the page is untill the time when the formstate expired and is removed by the garbage collection of the formstate handler |
public
string
|
#
GenerateAjaxActionId( )
Generates Ajax Action ID used to keep track of Ajax Actions It uses the counter variable to maintain uniqueness for Ajax Action IDs during the life of the page Life of the page is untill the time when the formstate expired and is removed by the garbage collection of the formstate handler |
protected
|
|
protected
|
#
Form_Load( )
To contain the code which should be executed after the Form Run and before the custom handlers are called (In case it is to be used, it should be overridden by a child class) In this situation, we are about to process an event, or the user has reloaded the page. Do whatever you need to do before any event processing. |
protected
|
#
Form_Create( )
To contain the code to initialize the QForm on the first call. Once the QForm is created, the state is saved and is reused by the Run method. In short - this function will run only once (the first time the QForm is to be created) (In case it is to be used, it should be overriden by a child class) |
protected
|
#
Form_PreRender( )
To contain the code to be executed after Form_Run, Form_Create, Form_Load has been called and the custom defined event handlers have been executed but actual rendering process has not begun. This is a good place to put data into a session variable that you need to send to other forms. |
protected
|
#
Form_Initialize( )
Override this method to set data in your form controls. Appropriate things to do would be to: - Respond to options sent by _GET or _POST variables. - Load data into the control from the database - Initialize controls whose data depends on the state or data in other controls. |
protected
boolean
|
|
protected
|
#
Form_Invalid( )
If you want to respond in some way to an invalid form that you have not already been able to handle, override this function. For example, you could display a message that an error occurred with some of the controls. |
protected
|
|
public
mixed
|
|
public
mixed|null
|
#
CheckableControlValue( $strControlId )
Returns the value of a checkable control. Checkable controls are special, in that the browser only tells us when a control is checked, not when it is unchecked. So, unless we keep track of them specially, we will not know if they are unchecked, or just not there. |
protected static
boolean
|
|
public
|
|
public static
|
#
Run( string $strFormClass, string|null $strAlternateHtmlFile = null, string|null $strFormId = null )
This method initializes the actual layout of the form It runs in all cases including initial form (the time when Form_Create is run) as well as on trigger actions (QServerAction, QAjaxAction, QServerControlAction and QAjaxControlAction) |
protected static
mixed|string
|
|
public
|
|
public static
|
#
InvalidFormState( )
An invalid form state was found. We were handed a formstate, but the formstate could not be interpreted. This could be for a variety of reasons, and is dependent on the formstate handler. Most likely, the user hit the back button past the back button limit of what we remember, or the user lost the session. Or, you simply have not set up the form state handler correctly. In the past, we threw an exception, but that was not a very user friendly response. The response below resubmits the url without a formstate so that a new one will be created. Override if you want a different response. |
public
|
#
CallDataBinder( callable $callable,
Calls a data binder associated with the form. Does this so data binder can be protected. Mostly for legacy code. |
protected
string
|
|
protected
|
#
RenderAjax( )
Renders the actual ajax return value as a json object. Since json must be UTF-8 encoded, will convert to UTF-8 if needed. Response is parsed in the "success" function in qcubed.js, and handled there. |
public static
string
|
|
public static
|
#
Unserialize( string $strPostDataState )
Unserializes (extracts) the FormState using the 'Load' method of FormStateHandler set in configuration.inc.php |
public
|
|
public
null|
|
|
public
|
#
RemoveControl( string $strControlId )
Removes a QControl (and its children) from the current QForm |
public
mixed|
|
|
public
|
|
protected
|
|
public
|
#
SetCustomAttribute( string $strName, string $strValue )
Custom Attributes are other html name-value pairs that can be rendered within the form using this method. For example, you can now render the autocomplete tag on the QForm additional javascript actions, etc. $this->SetCustomAttribute("autocomplete", "off"); Will render: [form ...... autocomplete="off"] (replace sqare brackets with angle brackets) |
public
mixed
|
#
GetCustomAttribute( string $strName )
Returns the requested custom attribute from the form. This attribute must have already been set. |
public
|
|
public
|
|
public
|
|
public
|
|
public
mixed
|
|
public
|
#
GetChildControls(
Returns the child controls of the current QForm or a QControl object |
public
string
|
#
EvaluateTemplate( string $strTemplate )
This function evaluates the QForm Template. It will try to open the Template file specified in the call to 'Run' method for the QForm and then execute it. |
protected
|
#
TriggerMethod( string $strControlId, string $strMethodName,
Triggers an event handler method for a given control ID NOTE: Parameters must be already validated and are guaranteed to exist. |
protected
boolean
|
#
ValidateControlAndChildren(
Calles 'Validate' method on a QControl recursively |
protected
|
#
TriggerActions( null|string $strControlIdOverride = null )
Runs/Triggers any and all event handling functions for the control on which an event took place Depending on the control's CausesValidation value, it also calls for validation of the control or control and children or entire QForm. |
protected
|
|
protected
null|string
|
|
protected
|
|
public
null|string
|
#
RenderStyles( boolean $blnDisplayOutput = true, $blnInHead = true )
Renders the tags to include the css style sheets. Call this in your head tag if you want to put these there. Otherwise, the styles will automatically be included just after the form. |
public
null|string
|
|
protected
string[]
|
#
ProcessJavaScriptList( string $strJavaScriptFileList )
Internal helper function used by RenderBegin and by RenderAjax Given a comma-delimited list of javascript files, this will return an array of files that NEED to still be included because (1) it hasn't yet been included and (2) it hasn't been specified to be "ignored". |
protected
string[]
|
#
ProcessStyleSheetList( string $strStyleSheetFileList )
Primarily used by RenderBegin and by RenderAjax Given a comma-delimited list of stylesheet files, this will return an array of file that NEED to still be included because (1) it hasn't yet been included and (2) it hasn't been specified to be "ignored". |
public
boolean
|
#
IsPostBack( )
Returns whether or not this Form is being run due to a PostBack event (e.g. a ServerAction or AjaxAction) |
public
string[]
|
#
GetErrorMessages( boolean $blnErrorsOnly = false )
Will return an array of Strings which will show all the error and warning messages in all the controls in the form. |
public
|
#
GetErrorControls( boolean $blnErrorsOnly = false )
Will return an array of QControls from the form which have either an error or warning message. |
public
string
|
|
public
string
|
|
protected
array
|
#
GetFormJavaScripts( )
Get high level form javascript files to be included. Default here includes all javascripts needed to run qcubed. Override and add to this list and include javascript and jQuery files and libraries needed for your application. Javascript files included before QCUBED_JS_CORE can refer to jQuery as $. After qcubed.js, $ becomes $j, so add other libraries that need $ in a different context after qcubed.js, and insert jQuery libraries and plugins that refer to $ before qcubed.js file. |
public
null|string
|
OverrideAttributes(),
__call()
|
integer |
FormStatusUnrendered
Form has not started rendering |
#
1
|
integer |
FormStatusRenderBegun
Form has started rendering but has not finished |
#
2
|
integer |
FormStatusRenderEnded
Form rendering has already been started and finished |
#
3
|
protected static
boolean
|
$blnStylesRendered
True when css scripts get rendered on page. Lets user call RenderStyles in header. |
#
false
|
protected
string
|
$strFormId
Form ID (usually passed as the first argument to the 'Run' method call) |
|
protected
integer
|
$intFormStatus
representational integer value of what state the form currently is in |
|
protected
|
$objControlArray
Array of QControls with this form as the parent |
|
protected
|
$objGroupingArray
List of Groupings in the form (for old drag and drop) Use of this is deprecated in favor of jQueryUI drag and drop, but code remains in case we need it again. |
|
protected
boolean
|
$blnRenderedBodyTag
Has the body tag already been rendered? |
#
false
|
protected
array
|
$checkableControlValues
|
#
array()
|
protected
string
|
$strCallType
The type of call made to the QForm (Ajax, Server or Fresh GET request) |
|
protected
null| |
$objDefaultWaitIcon
Default wait icon for the page/QForm |
#
null
|
protected
array
|
$strFormAttributeArray
|
#
array()
|
protected
array
|
$strIncludedJavaScriptFileArray
List of included JavaScript files for this QForm |
#
array()
|
protected
array
|
$strIgnoreJavaScriptFileArray
List of ignored JavaScript files for this QForm |
#
array()
|
protected
array
|
$strIncludedStyleSheetFileArray
List of included CSS files for this QForm |
#
array()
|
protected
array
|
$strIgnoreStyleSheetFileArray
List of ignored CSS files for this QForm |
#
array()
|
protected
boolean
|
$strPreviousRequestMode
|
#
false
|
protected
string
|
$strHtmlIncludeFilePath
The QForm's template file path. When this value is not supplied, the 'Run' function will try to find and use the .tpl.php file with the same filename as the QForm in the same same directory as the QForm file. |
|
protected
string
|
$strCssClass
CSS class to be set for the 'form' tag when QCubed Renders the QForm |
|
protected
|
$strCustomAttributeArray
|
#
null
|
public static
null|string
|
$EncryptionKey
The key to encrypt the formstate when saving and retrieving from the chosen FormState handler |
#
null
|
public static
string
|
$FormStateHandler
Chosen FormStateHandler default is QFormStateHandler as shown here, however it is read from the configuration.inc.php (in the QForm class) In case something goes wrong with QForm, the default FormStateHandler here will try to take care of the situation. |
#
'QFormStateHandler'
|
protected
integer
|
$intNextControlId
Counter variable to contain the numerical part of the Control ID value. it is automatically incremented everytime the GenerateControlId() runs |
#
1
|
protected
integer
|
$intNextAjaxActionId
Counter variable to contain the numerical part of the AJAX ID value. it is automatically incremented everytime the GenerateAjaxActionId() runs |
#
1
|
public
string
|
$HtmlIncludeFilePath
(Alternate) path to the template file to be used |
public
string
|
$CssClass
Form CSS class. |
public read-only
string
|
$FormId
Form ID of the QForm |
public read-only
string
|
$CallType
Type of call (useful when the QForm submits due to user action) |
public read-only
|
$DefaultWaitIcon
Default Ajax wait icon control |
public read-only
integer
|
$FormStatus
Status of form (pre-render stage, rendering stage of already rendered stage) |