Hello
I have used the example concerning moving controls from one panel to the other. I have been successful in populating the left panel with textboxes from my database. I can move the controls from one panel to the other and back.
Here is my dilema. At save time I need to know which controls are contained in the right panel. I actually need the Textbox[boxnum]->text.
How do I get that info from the the Right panel
Here is my code.
...
// Fill Textboxes with availalbe Pages, and put it into the left Panel
$boxnum = null;
$objavailablepageArray = Page::LoadAll();
foreach($objavailablepageArray as $objavailablepage) {
$boxnum++;
// The parent must be the panel, because the panel is going to be responsible
// for rendering it.
$this->txtTextbox[$boxnum] = new QTextBox($this->pnlLeft);
$this->txtTextbox[$boxnum]->Text = sprintf('%s', $objavailablepage);
$this->txtTextbox[$boxnum]->Width = 250;
$this->txtTextbox[$boxnum]->AddAction(new QClickEvent(), new QAjaxAction('MoveMe'));
$this->txtTextbox[$boxnum]->ActionParameter = 'right';
}
...
protected function MoveMe($strFormId, $strControlId, $strParameter) {
if ($strParameter == 'left') {
$pnlSource = $this->pnlRight;
$pnlDestination = $this->pnlLeft;
$newsource = 'right';
} else {
$pnlSource = $this->pnlLeft;
$pnlDestination = $this->pnlRight;
$newsource = 'left';
}
// Get the Source's Child Controls
$objChildControl = $pnlSource->GetChildControl($strControlId);
$objChildControl->ActionParameter = $newsource;
$objChildControl->SetParentControl($pnlDestination);
}
...