QCubed - A PHP5 rapid development MVC framework.
Home  |  Updates

QDialogBox

How can I call an ajax action in the close window button

Hello,

Is there a way to call an Ajax Action on the close window button of a QDialogBox ?

Something like

$MyDialog->CloseWindowMethod = 'btnClose_Click';

Thank you in advance.

QDialogBox Error in 2.0

I am having an issue dynamically loading QPanels in a QDialogBox in QCubed version 2.0.1. When I click a control that triggers the QDialogBox the first time it renders properly, however when I close the QDialog and click a control to open it again the Dynamically loaded panel does not appear. After closing the second attempt and then clicking another control that triggers the panel the dynamic panel now appears again. Here is the simplified code. It is basically the same logic as the form drafts, except the edit panel is loaded into a QDialogBox rather than a QPanel. This code works in QCubed Version 1.1.2.

DialogTest.php

<?php
   
require_once('qcubed.inc.php'); 
   
    class
DialogTest extends QForm {       
        protected
$pnlTopLeft;
        protected
$pnlTopCenter;        
       
        protected
$pnlDialog;
        protected
$pnlEdit;

        protected function
Form_Create() {
          
           
$this->pnlDialog = new QDialogBox($this);
           
$this->pnlDialog->AutoRenderChildren = true;

           
$this->pnlTopLeft = new QPanel($this, 'TopLeft');
           
$this->pnlTopLeft->AutoRenderChildren = true;
           
           
$this->pnlTopCenter = new QPanel($this, 'TopCenter');
           
$this->pnlTopCenter->AutoRenderChildren = true;          
           
           
$this->pnlEdit = new QPanel($this->pnlDialog, 'pnlEdit');
           
$this->pnlEdit->Text = 'PnlEdit Rendered';
           
$this->pnlEdit->AutoRenderChildren = true;
           
           
$pnlCompliance = new UserListPanel($this->pnlTopCenter, 'SetEditPane', 'CloseEditPane');
           
$pnlCBC = new VendorListPanel($this->pnlTopLeft, 'SetEditPane', 'CloseEditPane');           
        }
        public function
CloseEditPane($blnUpdatesMade) {
           
// Close the Edit Pane                     
           
$this->pnlEdit->RemoveChildControls(true);
           
$this->pnlDialog->HideDialogBox();
        }

        public function
SetEditPane(QPanel $objPanel = null) {
           
$this->pnlEdit->RemoveChildControls(true);
            if (
$objPanel) {
               
$objPanel->SetParentControl($this->pnlEdit);
               
$this->pnlDialog->ShowDialogBox();
            } else {
               
$this->pnlDialog->HideDialogBox();
            }
        }
    }

   
DialogTest::Run('DialogTest');
?>

DialogTest.tpl.php

<?php
   
include('includes/configuration/header.inc.php');
   
$this->RenderBegin();
   
$this->pnlDialog->Render();
   
$this->pnlTopLeft->Render();
   
$this->pnlTopCenter->Render();
   
$this->RenderEnd();
    include(
'includes/configuration/footer.inc.php');
?>

QDialogBox Modal vs. Non-Modal

First off let me just say I was never a fan of frameworks because of their proprietary feel and non-PHPesq syntax, and when I recently came across QCubed it was as if someone out there had EXACTLY the same idea of how a framework should be written so bravo.

Now, down to business. I'm running QCubed 2.0 with JQuery, and I came across a small bug/enhancement with the QDialog Box. In the Examples pages it is mentioned that a Dialog Box can either be Modal or Non-Modal. Upon searching for how to convert a Modal dialog box to a Non-Modal dialog box I was met with no examples or results. So, I opened up the QDialogBox class and discovered that the Modal JQuery property was hard coded to true in an sprintf statement. Specifically line 53 of QDialogBox.class.php. I have attached my modification of the class with an section to the __set function allowing you to specify whether the Dialog is modal or not. Let me know your thoughts.

Dialog box instead of Wait icon

Has anyone implemented functionality, where dialog box is shown instead of wait icon? I can probably open up dialog box with JS when ajax request is started. And close it right after it (with QCubed response or directly from js). Then again, this might be useful functionality to add to the core?

For example, I have a form. If I click "submit", I don't want user to modify the form any more. So, if I open up dialog box which disables all the page, I can achieve it easily. If I want, I still can have "loading" icon inside dialog box (which might even be default QWaitDialogBox or smth).

QDialogBox Isse

Hello all,

Firstly, nice work on the qcube site! I've been using qcodo for about 3 years and finally just switched over. Looks great so far.

Anyway, I'm having an issue with a QDialogBox. What I'm trying to do is open a new dialog box and based on user input pass a parameter to it. This is the flow:

1. User selects Model via drop-down
2. ModelID is passed to QDialogBox
3. DialogBox displays products based on ModelID
(Optional)
4. User closes DialogBox
5. User selects new Model and new DialogBox is opened.

Here is my code: