Overview

Packages

  • Actions
  • Codegen
  • Controls
    • Base
  • DatabaseAdapters
  • Events
  • None
  • Sessions
  • Tests

Classes

  • QAction
  • QAjaxAction
  • QAjaxControlAction
  • QAlertAction
  • QBlurControlAction
  • QConfirmAction
  • QCssAction
  • QCssClassAction
  • QFocusControlAction
  • QHideCalendarAction
  • QHideDialog
  • QHideDialogBox
  • QJavaScriptAction
  • QJQAction
  • QJQBounceAction
  • QJQHideAction
  • QJQHideEffectAction
  • QJQHighlightAction
  • QJQPulsateAction
  • QJQShakeAction
  • QJQShowAction
  • QJQShowEffectAction
  • QJQSizeAction
  • QJQToggleAction
  • QJQToggleEffectAction
  • QJQTransferAction
  • QRedirectAction
  • QRegisterClickPositionAction
  • QResetTimerAction
  • QSelectControlAction
  • QServerAction
  • QServerControlAction
  • QSetValueAction
  • QShowCalendarAction
  • QShowDialog
  • QShowDialogBox
  • QStopPropagationAction
  • QTerminateAction
  • QToggleCssClassAction
  • QToggleDisplayAction
  • QToggleEnableAction
  • Overview
  • Package
  • Class

Class QAjaxAction

The QAjaxAction responds to events with ajax calls, which refresh a portion of a web page without reloading the entire page. They generally are faster than server requests and give a better user experience.

The QAjaxAction will associate a callback (strMethodName) with an event as part of an AddAction call. The callback will be a method in the current QForm object. To associate a method that is part of a QControl, or any kind of a callback, use a QAjaxControlAction.

The wait icon is a spinning gif file that can be overlayed on top of the control to show that the control is in a "loading" state. TODO: Convert this to a FontAwesome animated icon.

mixCausesValidationOverride allows you to selectively say whether this action causes a validation, and on what subset of controls.

strJsReturnParam is a javascript string that specifies what the action parameter will be, if you don't want the default.

blnAsync lets you respond to the event asynchronously. Use care when setting this to true. Normally, qcubed will put events in a queue and wait for each event to return a result before executing the next event. Most of the time, the user experience is fine with this. However, there are times when events might be firing quickly and you do not want to wait. However, your QFormState handler must be able to handle asynchronous events. The default QFormStateHandler cannot do this, so you will need to use a different one.

QBaseClass
Extended by QAction
Extended by QAjaxAction

Direct known subclasses

QAjaxControlAction, QNoScriptAjaxAction
Package: Actions
Located at includes/base_controls/_actions.inc.php
Methods summary
public
# __construct( string $strMethodName = null, string|QWaitIcon $objWaitIconControl = 'default', null|mixed $mixCausesValidationOverride = null, string $strJsReturnParam = "", boolean $blnAsync = false )

AjaxAction constructor.

AjaxAction constructor.

Parameters

$strMethodName
Name of the event handler function to be called
$objWaitIconControl
Wait Icon for the action
$mixCausesValidationOverride
what kind of validation over-ride is to be implemented
$strJsReturnParam

the line of javascript which would set the 'strParameter' value on the client-side when the action occurs!

$blnAsync

True to have the events for this action fire asynchronously. Be careful when setting this to true. See class description.

public
# __clone( )
public mixed|null|string
# __get( string $strName )

PHP Magic function to get the property values of a class object

PHP Magic function to get the property values of a class object

Parameters

$strName
Name of the property

Returns

mixed|null|string

Throws

QCallerException

Overrides

QAction::__get()
protected string
# getActionParameter( QControl $objControl )

Returns the control's ActionParameter in string format

Returns the control's ActionParameter in string format

Parameters

$objControl

Returns

string
public string
# RenderScript( QControl $objControl )

Returns the RenderScript script for the action. The returned script is to be executed on the client side when the action is executed (in this case qc.pA function is executed)

Returns the RenderScript script for the action. The returned script is to be executed on the client side when the action is executed (in this case qc.pA function is executed)

Parameters

$objControl

Returns

string
Methods inherited from QAction
RenderActions(), __set()
Methods inherited from QBaseClass
OverrideAttributes(), __call()
Properties summary
protected string $strId

Ajax Action ID

Ajax Action ID

#
protected string $strMethodName

The event handler function name

The event handler function name

#
protected QWaitIcon $objWaitIconControl

Wait Icon to be used for this particular action

Wait Icon to be used for this particular action

#
protected boolean $blnAsync
# false
protected mixed $mixCausesValidationOverride

what kind of validation over-ride is to be implemented (See the QCausesValidation class and QFormBase class to understand in greater depth)

what kind of validation over-ride is to be implemented (See the QCausesValidation class and QFormBase class to understand in greater depth)

#
protected string $strJsReturnParam

the line of javascript which would set the 'strParameter' value on the client-side when the action occurs!

the line of javascript which would set the 'strParameter' value on the client-side when the action occurs!

#
Properties inherited from QAction
$objEvent
Magic properties summary
public read-only $MethodName

Name of the (event-handler) method to be called the event handler - function containing the actual code for the Ajax action

public read-only QWaitIcon $WaitIconControl

the waiting icon control for this Ajax Action

public read-only mixed $CausesValidationOverride

what kind of validation over-ride is to be implemented on this action.(See the QCausesValidation class and QFormBase class to understand in greater depth)

Magic properties inherited from QAction
$Event
API documentation generated by ApiGen