I have a parent QPanel which has 2 children QPanels. Furthermore, the parent QPanel has a save button. Thus, parent panel looks as follows:
class MyPanel extends QPanel
{
public $panel1;
public $panel2;
public $btnSave;
public function __construct( $objParentObject,
$strPanelRightControlId = null,
$strControlId = null )
{
//call the parent's constructor first
try {
parent::__construct($objParentObject, $strControlId );
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$strDraftsPath = sprintf(__DRAFTS__, 'default');
$this->strTemplate = $strDraftsPath . '/my_panel.tpl.php';
$objFc = Zend_Controller_Front::getInstance();
$intId = User::AutoloadId();
$this->panel1 = new Panel1( $this, $intId, 'panel1');
$this->panel2 = new Panel2( $this, $intId, 'panel2');
$this->btnSave_Create();
}
public function btnSave_Create()
{
$this->btnSave = new QButton($this);
$this->btnSave->Text = 'Save These Changes';
$this->btnSave->AddAction( new QClickEvent(),
new QServerControlAction( $this, 'btnSave_Click' ) );
$this->btnSave->CausesValidation = $this;
}
public function btnSave_Click()
{
$this->panel1->btnSave_Click();
$this->panel2->btnSave_Click();
}
Next, each child panel has its own validation and initialization methods but when I click the save button, the information in panel1 doesn't get properly saved. If anyone has any ideas as to how to resolve this, please feel free to post.
Thanks in advance,
-Conrad