Overview

Packages

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

Classes

  • QAccordionBase
  • QAccordionGen
  • QAutocompleteBase
  • QAutocompleteGen
  • QDatepickerBase
  • QDatepickerBoxBase
  • QDatepickerBoxGen
  • QDatepickerGen
  • QDialogBase
  • QDialogGen
  • QDraggableBase
  • QDraggableGen
  • QDroppableBase
  • QDroppableGen
  • QFieldset
  • QJqButtonBase
  • QJqButtonGen
  • QJqCheckBoxBase
  • QJqCheckBoxGen
  • QJqRadioButtonBase
  • QJqRadioButtonGen
  • QMenuBase
  • QMenuGen
  • QProgressbarBase
  • QProgressbarGen
  • QResizableBase
  • QResizableGen
  • QSelectableBase
  • QSelectableGen
  • QSelectMenu
  • QSelectMenuBase
  • QSelectMenuGen
  • QSliderBase
  • QSliderGen
  • QSortableBase
  • QSortableGen
  • QSpinnerBase
  • QSpinnerGen
  • QTabsBase
  • QTabsGen
  • QTextBoxBase
  • Overview
  • Package
  • Class

Class QDialogBase

Implements a JQuery UI Dialog

A QDialog is a QPanel that pops up on the screen and implements an "in window" dialog.

There are a couple of ways to use the dialog. The simplest is as follows:

In your Form_Create():

$this->dlg = new QDialog($this);
$this->dlg->AutoOpen = false;
$this->dlg->Modal = true;
$this->dlg->Text = 'Show this on the dialog.'
$this->dlg->AddButton ('OK', 'ok');
$this->dlg->AddAction (new QDialog_ButtonEvent(), new QHideDialog());

When you want to show the dialog:

$this->dlg->Open();

And, also remember to draw the dialog in your form template:

$this->dlg->Render();

Since QDialog is a descendant of QPanel, you can do anything you can to a normal QPanel, including add QControls and use a template. When you want to hide the dialog, call

Close()
QBaseClass
Extended by QHtmlAttributeManagerBase
Extended by QHtmlAttributeManager
Extended by QControlBase
Extended by QControl
Extended by QBlockControl
Extended by QPanel
Extended by QDialogGen
Extended by QDialogBase

Direct known subclasses

QDialog

Indirect known subclasses

CalculatorWidget, QFileAssetDialog, QModelConnectorEditDlg
Package: Controls\Base
Link: http://jqueryui.com/dialog/
Located at includes/base_controls/QDialogBase.class.php
Methods summary
public
# __construct( QControl|QForm|QControlBase $objParentObject, string $strControlId = null )

Creates a QControlBase object This constructor will generally not be used to create a QControlBase object. Instead it is used by the classes which extend the class. Only the parent object parameter is required. If the option strControlId parameter is not used, QCubed will generate the id.

Creates a QControlBase object This constructor will generally not be used to create a QControlBase object. Instead it is used by the classes which extend the class. Only the parent object parameter is required. If the option strControlId parameter is not used, QCubed will generate the id.

Parameters

$objParentObject
$strControlId

optional id of this Control. In html, this will be set as the value of the id attribute. The id can only contain alphanumeric characters. If this parameter is not passed, QCubed will generate the id.

Throws

Exception|QCallerException

Overrides

QControlBase::__construct()
public boolean
# ValidateControlAndChildren( )

Validate the child items if the dialog is visible and the clicked button requires validation. This piece of magic makes validation specific to the dialog if an action is coming from the dialog, and prevents the controls in the dialog from being validated if the action is coming from outside the dialog.

Validate the child items if the dialog is visible and the clicked button requires validation. This piece of magic makes validation specific to the dialog if an action is coming from the dialog, and prevents the controls in the dialog from being validated if the action is coming from outside the dialog.

Returns

boolean

Overrides

QControlBase::ValidateControlAndChildren()
public string
# getJqControlId( )

Returns the control id for purposes of jQuery UI.

Returns the control id for purposes of jQuery UI.

Returns

string
public string
# GetEndScript( )

Overrides the parent to add code to cause the default button to be fired if an enter key is pressed on a control. This purposefully does not include textarea controls, which should get the enter key to insert a newline.

Overrides the parent to add code to cause the default button to be fired if an enter key is pressed on a control. This purposefully does not include textarea controls, which should get the enter key to insert a newline.

Returns

string

Overrides

QDialogGen::GetEndScript()
protected string
# StylingJs( )

Add additional javascript to the dialog creation to further format the dialog. This will set the class of the title bar to the strDialogState value and add an icon to implement a dialog state. Override and restyle for a different look.

Add additional javascript to the dialog creation to further format the dialog. This will set the class of the title bar to the strDialogState value and add an icon to implement a dialog state. Override and restyle for a different look.

Returns

string
protected string
# MakeJqOptions( )

Implements QCubed specific dialog functions. Makes sure dialog is put at the end of the form to fix an overlay problem with jQuery UI.

Implements QCubed specific dialog functions. Makes sure dialog is put at the end of the form to fix an overlay problem with jQuery UI.

Returns

string

Overrides

QDialogGen::MakeJqOptions()
public
# AddButton( string $strButtonName, string $strButtonId = null, boolean $blnCausesValidation = false, boolean $blnIsPrimary = false, string $strConfirmation = null, array $options = null )

Adds a button to the dialog. Use this to add buttons BEFORE bringing up the dialog.

Adds a button to the dialog. Use this to add buttons BEFORE bringing up the dialog.

Parameters

$strButtonName
$strButtonId

Id associated with the button for detecting clicks. Note that this is not the id on the form. Different dialogs can have the same button id. To specify a control id for the button (for styling purposes for example), set the id in options.

$blnCausesValidation
If the button causes the dialog to be validated before the action is executed
$blnIsPrimary
Whether this button will be automatically clicked if user presses an enter key.
$strConfirmation
If set, will confirm with the given string before the click is sent
$options

Additional attributes to add to the button. Useful things to do are: array('class'=>'ui-button-left') to create a button on the left side. array('class'=>'ui-priority-primary') to style a button as important or primary.

public
# RemoveButton( $strButtonId )

Remove the given button from the dialog.

Remove the given button from the dialog.

Parameters

$strButtonId
public
# RemoveAllButtons( )

Remove all the buttons from the dialog.

Remove all the buttons from the dialog.

public
# ShowHideButton( $strButtonId, $blnVisible )

Show or hide the given button. Changes the display attribute, so the buttons will reflow.

Show or hide the given button. Changes the display attribute, so the buttons will reflow.

Parameters

$strButtonId
$blnVisible
public
# SetButtonStyle( string $strButtonId, array $styles )

Applies CSS styles to a button that is already in the dialog.

Applies CSS styles to a button that is already in the dialog.

Parameters

$strButtonId
Id of button to set the style on
$styles
Array of key/value style specifications
public
# AddCloseButton( $strButtonName )

Adds a close button that just closes the dialog without firing the QDialogButton event. You can trap this by adding an action to the QDialog_CloseEvent.

Adds a close button that just closes the dialog without firing the QDialogButton event. You can trap this by adding an action to the QDialog_CloseEvent.

Parameters

$strButtonName
public static QDialog
# Alert( QForm $strMessage, string $strButtons = null, string|string[]|null $strControlId = null, string|null $strControlId,… )

Create a message dialog. Automatically adds an OK button that closes the dialog. To detect the close, add an action on the QDialog_CloseEvent. To change the message, use the return value and set ->Text. To detect a button click, add a QDialog_ButtonEvent.

Create a message dialog. Automatically adds an OK button that closes the dialog. To detect the close, add an action on the QDialog_CloseEvent. To change the message, use the return value and set ->Text. To detect a button click, add a QDialog_ButtonEvent.

If you specify no buttons, a close box in the corner will be created that will just close the dialog. If you specify just a string in $strButtons, or just one string in the button array, one button will be shown that will just close the message.

If you specify more than one button, the first button will be the default button (the one pressed if the user presses the return key). In this case, you will need to detect the button by adding a QDialog_ButtonEvent. You will also be responsible for calling "Close()" on the dialog after detecting a button.

Parameters

$strMessage
$objForm // The parent object, which should always be the form itself.
$strButtons
$strMessage // The message
$strControlId
$strButtons
$strControlId,…

Returns

QDialog
protected
# alert_Close( $strFormId, $strControlId, $strParameter )

An alert is closing, so we remove the dialog from the dom.

An alert is closing, so we remove the dialog from the dom.

Parameters

$strFormId
$strControlId
$strParameter
public
# ShowDialogBox( )

Show the dialog.

Show the dialog.

public
# HideDialogBox( )

Hide the dialog

Hide the dialog

public mixed
# __set( string $strName, string $mixValue )

PHP magic method

PHP magic method

Parameters

$strName
$mixValue

Returns

mixed

Throws

Exception|QCallerException|QInvalidCastException

Overrides

QDialogGen::__set()
public mixed
# __get( string $strName )

PHP magic method

PHP magic method

Parameters

$strName

Returns

mixed

Throws

Exception|QCallerException

Overrides

QDialogGen::__get()
Methods inherited from QDialogGen
Close(), Destroy(), GetJqSetupFunction(), GetModelConnectorParams(), Instance(), IsOpen(), MoveToTop(), Open(), Option(), Option1(), Option2(), Option3()
Methods inherited from QBlockControl
AddControlToMove(), AddDropZone(), GetControlHtml(), GetInnerHtml(), ParsePostData(), RemoveAllControlsToMove(), RemoveAllDropZones(), RemoveControlToMove(), RemoveDropZone(), Validate()
Methods inherited from QControlBase
AddAction(), AddActionArray(), AddAttributeScript(), AddChildControl(), AddCssFile(), AddJavascriptFile(), AddPluginCssFile(), AddPluginJavascriptFile(), AddWrapperCssClass(), Blink(), EvaluateTemplate(), Focus(), ForgetState(), GetAllActions(), GetAttributes(), GetChildControl(), GetChildControls(), GetControlFromHierarchyByMethodName(), GetCustomAttribute(), GetCustomAttributes(), GetCustomStyle(), GetEndHtml(), GetForm(), GetJavaScriptForEvent(), GetJqControlId(), GetNonWrappedHtml(), GetState(), GetStyleAttributes(), GetTemplatePath(), GetWrapperAttributes(), GetWrapperStyleAttributes(), GetWrapperStyler(), IsDescendantOf(), IsModified(), MakeCurrent(), MarkAsModified(), MarkAsRendered(), MarkAsWrapperModified(), ProcessActionParameters(), PutState(), Refresh(), RemoveAllActions(), RemoveChildControl(), RemoveChildControls(), RemoveCustomAttribute(), RemoveCustomStyle(), RemoveWrapperCssClass(), Render(), RenderActionScripts(), RenderAjax(), RenderAttributeScripts(), RenderChildren(), RenderComment(), RenderCssStyles(), RenderExtensionRenderer(), RenderHelper(), RenderHtmlAttributes(), RenderOutput(), RenderWithError(), RenderWithName(), RenderWrappedOutput(), ResetFlags(), ResetOnPageStatus(), SetCustomAttribute(), SetCustomStyle(), SetFocus(), SetForm(), SetParentControl(), Sleep(), SleepHelper(), ValidationReset(), VarExport(), Wakeup(), WakeupHelper(), Watch(), _CallActionMethod(), _ProcessActionParams(), _ReadState(), _WriteState()
Methods inherited from QHtmlAttributeManagerBase
AddCssClass(), GetCssStyle(), GetDataAttribute(), GetHtmlAttribute(), GetHtmlAttributes(), HasCssClass(), HasCssStyle(), HasHtmlAttribute(), Override(), RemoveCssClass(), RemoveCssClassesByPrefix(), RemoveCssStyle(), RemoveDataAttribute(), RemoveHtmlAttribute(), RenderTag(), SetCssBoxValue(), SetCssClass(), SetCssStyle(), SetDataAttribute(), SetHtmlAttribute()
Methods inherited from QBaseClass
OverrideAttributes(), __call()
Constants summary
string StateNone

Default dialog state

Default dialog state

# ''
string StateError

Display using the Themeroller error state

Display using the Themeroller error state

# 'ui-state-error'
string StateHighlight

Display using the Themeroller highlight state

Display using the Themeroller highlight state

# 'ui-state-highlight'
string MessageDialogId

The control id to use for the reusable global alert dialog.

The control id to use for the reusable global alert dialog.

# 'qAlertDialog'
Constants inherited from QControlBase
CommentEnd, CommentStart
Properties summary
protected boolean $blnAutoOpen

default to auto open being false, since this would be a rare need, and dialogs are auto-rendered.

default to auto open being false, since this would be a rare need, and dialogs are auto-rendered.

# false
protected string $strClickedButtonId

Id of last button clicked.

Id of last button clicked.

#
protected boolean $blnHasCloseButton

Should we draw a close button on the top?

Should we draw a close button on the top?

# true
protected boolean $blnIsOpen

records whether dialog is open

records whether dialog is open

# false
protected array $blnValidationArray

whether a button causes validation

whether a button causes validation

# array()
protected boolean $blnUseWrapper

Should the wrapper be used when rendering?

Should the wrapper be used when rendering?

# true
protected string $strDialogState

state of the dialog for special display

state of the dialog for special display

#
protected boolean $blnAutoRender

true to have the control be automatically rendered without an explicit "Render..." call. This is used by QDialogs, and other similar controls that are controlled via javascript, and generally start out hidden on the page. These controls are appended to the form after all other controls.

true to have the control be automatically rendered without an explicit "Render..." call. This is used by QDialogs, and other similar controls that are controlled via javascript, and generally start out hidden on the page. These controls are appended to the form after all other controls.

# true
Properties inherited from QDialogGen
$blnCloseOnEscape, $blnDraggable, $blnModal, $blnResizable, $intMaxHeight, $intMaxWidth, $intMinHeight, $intMinWidth, $intWidth, $mixAppendTo, $mixButtons, $mixHeight, $mixHide, $mixPosition, $mixShow, $strCloseText, $strDialogClass, $strJavaScripts, $strStyleSheets, $strTitle
Properties inherited from QPanel
$blnHtmlEntities, $blnIsBlockElement, $strDefaultDisplayStyle, $strTagName
Properties inherited from QBlockControl
$blnAutoRenderChildren, $blnDropTarget, $objDropsControlsArray, $objDropsGroupingsArray, $objIsDropZoneFor, $objMovesControlsArray, $strFormat, $strTemplate, $strText
Properties inherited from QControlBase
$blnActionsMustTerminate, $blnDisplay, $blnMinimize, $blnModified, $blnOnPage, $blnRendered, $blnRendering, $blnRequired, $blnSaveState, $blnScriptsOnly, $blnVisible, $blnWrapLabel, $blnWrapperModified, $mixActionParameter, $mixCausesValidation, $objActionArray, $objChildControlArray, $objDraggable, $objDroppable, $objForm, $objLinkedNode, $objParentControl, $objResizable, $objWatcher, $objWrapperStyler, $strAttributeScripts, $strControlId, $strCssClass, $strCustomAttributeArray, $strCustomStyleArray, $strFormAttributes, $strHtmlAfter, $strHtmlBefore, $strInstructions, $strName, $strPreferredRenderMethod, $strRenderMethod, $strValidationError, $strWarning
Properties inherited from QHtmlAttributeManagerBase
$attributes, $styles
Magic properties summary
public boolean $HasCloseButton

Disables (false) or enables (true) the close X in the upper right corner of the title. Can be set when initializing the dialog. Can be set when initializing the dialog. Also enables or disables the ability to close the box by pressing the ESC key.

public read-only integer $ClickedButton

Returns the id of the button most recently clicked. (read-only)

public write-only string $DialogState

Set whether this dialog is in an error or highlight (info) state. Choose on of QDialog::StateNone, QDialogState::StateError, QDialogState::StateHighlight (write-only)

Magic properties inherited from QDialogGen
$AppendTo, $AutoOpen, $Buttons, $CloseOnEscape, $CloseText, $DialogClass, $Draggable, $Height, $Hide, $MaxHeight, $MaxWidth, $MinHeight, $MinWidth, $Modal, $Position, $Resizable, $Show, $Title, $Width
Magic properties inherited from QBlockControl
$AutoRenderChildren, $DropTarget, $Format, $HorizontalAlign, $HtmlEntities, $ResizeHandleDirection, $ResizeHandleMaximum, $ResizeHandleMinimum, $TagName, $Template, $Text, $VerticalAlign
Magic properties inherited from QControlBase
$ActionParameter, $ActionsMustTerminate, $AutoRender, $CausesValidation, $ControlId, $Form, $FormAttributes, $HtmlAfter, $HtmlBefore, $Instructions, $JavaScripts, $LinkedNode, $Minimize, $Modified, $Moveable, $Name, $OnPage, $ParentControl, $PreferredRenderMethod, $RenderMethod, $Rendered, $Rendering, $Required, $SaveState, $ScriptsOnly, $StyleSheets, $UseWrapper, $ValidationError, $Visible, $Warning, $WrapLabel, $WrapperCssClass, $WrapperModified
Magic properties inherited from QHtmlAttributeManagerBase
$AccessKey, $AltText, $BackColor, $BorderCollapse, $BorderColor, $BorderStyle, $BorderWidth, $CssClass, $Cursor, $Data, $Display, $DisplayStyle, $Enabled, $FontBold, $FontItalic, $FontNames, $FontOverline, $FontSize, $FontStrikeout, $FontUnderline, $ForeColor, $Left, $Margin, $NoWrap, $Opacity, $OrderedListType, $Overflow, $Padding, $ReadOnly, $TabIndex, $ToolTip, $Top, $UnorderedListStyle
API documentation generated by ApiGen