Sorry, yes the first couple of line are from a QForm subclass. There is a button click action on the QForm that creates a copy of the current form and then does a redirect to that new form.
I'm trying to call the show dialog method once the redirect to the new form is finished. The form subclass code is pretty long.
The QDialogBox subclass code is:
class NotePopUp extends QDialogBox {
// PUBLIC Child Controls
//public $pnlNoteDisplay;
public $btnSave;
public $btnCancel;
public $txtNote;
public $strCloseCallback;
// Default Overrides
protected $blnMatteClickable = false;
protected $strTemplate = 'NotePopUp.tpl.php';
protected $strCssClass = 'Note_popup';
protected $strToolTip = 'Please enter your note and click the Save button';
public function __construct($strCloseCallback, $objParentObject, $strControlId = null) {
parent::__construct($objParentObject, $strControlId);
$this->strCloseCallback = $strCloseCallback;
// Define local child controls
//$this->pnlNoteDisplay = new QPanel($this);
$this->txtNote = new QTextBox($this);
$this->txtNote->Required = true;
$this->txtNote->Name = “Note:”;
$this->txtNote->TextMode = QTextMode::MultiLine;
$this->txtNote->Width = '400';
$this->btnSave = new QButton($this);
$this->btnSave->Text = 'Save Note';
// stop any further actions on the currently processing event - clicks on save button
$this->btnSave->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnSave));
$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
$this->btnCancel = new QButton($this);
$this->btnCancel->Text = 'Cancel';
$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
}
public function btnCancel_Click() {
$this->HideDialogBox();
}
public function btnSave_Click() {
if (strlen(trim($this->txtNote->Text)) > 0)
{
call_user_func(array($this->objForm, $this->strCloseCallback));
$this->HideDialogBox();
}
else {
$this->txtNote->Warning = “Please enter your note.”;
}
}
public function ShowDialogBox() {
parent::ShowDialogBox();
$this->txtNote->Focus();
}
public function HideDialogBox() {
parent::HideDialogBox();
}
}
The QForm subclass creates an instance :
// dialog box for notes
$this->dlgAmendPopup = new NotePopUp('dlgNoteAmend_Close',$this);
The QForm subclass button action that causes the copy,redirect to that form and dialog popup:
protected function btnAmend_Click($strFormId, $strControlId, $strParameter) {
$this->btnCopy_Click($strFormId, $strControlId, $strParameter);
$this->noteType = 'regular';
$this->dlgAmendPopup->ShowDialogBox();
}
protected function btnCopy_Click($strFormId, $strControlId, $strParameter) {
// code ....
$strJs = “window.location = 'public_form_edit.php?intId=" . $this->objPublicForm->Id .
“&isCopied=true&CopiedTicket=" . $this->strCopiedTicketNumber . “'”;
QApplication::ExecuteJavaScript($strJs);
}
public function dlgNoteAmend_Close() {
$this->saveNote($this->dlgAmendPopup->txtNote->Text);
}
Hope this makes more sense.
Thank you for your help.