QuickForm_Controller: Trouble with Tabbed Pages
| From: | Massimiliano Bariola | Date: | Thu, 11 Dec 2003 17:23:14 +0000 |
| Subject: | QuickForm_Controller: Trouble with Tabbed Pages | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9477@lists.php.net to get a copy of this message | ||
My PEAR Rating: Novice
Gretings,
I am trying to set up a 2-page tabbed form. Unfortunately, I cannot
make the QFC switch between pages when tab controls are pressed.
I looked at the tabbed.php example, thus I set up my code like this:
$controller =& new HTML_QuickForm_Controller('myController', false);
$page1= new DetailPage('detailPage');
$page2= new FileList('fileList');
$page1->addAction('display', new ActionDisplayDetail());
$page2->addAction('display', new ActionDisplayFile());
$controller->addpage($page1);
$controller->addpage($page2);
$controller->addAction('process', new ActionProcess());
$controller->addAction('detailPage', new HTML_QuickForm_Action_Direct());
$controller->addAction('fileList', new HTML_QuickForm_Action_Direct());
$controller->run();
ActionDisplayDetail and ActionDisplayFile are identical save for
some variables differently set in the template. (I use SigmaTemplate and
ITDynamic to render the two pages with the same base template consistent look&feel)
DetailPage and FileList's buildForm() methods do their usual job, with
the relevant part (tabs) being added as follows:
$tabs[]=&$this->createElement('submit',
$this->getButtonName('detailPage'), 'Detail of Record',
array('disabled' => 'disabled', 'class' =>
'flatRed'));
$tabs[]=&$this->createElement('submit',
$this->getButtonName('fileList'), 'List of Files', array('class'
=> 'flatRed'));
$this->addGroup($tabs, 'tabs', null, ' ');
.....
etc.
after $controller->run() the first page is correctly displayed and
the page behaves correctly; the tab buttons are available on-screen,
but clicking on them effects nothing. Same page is reloaded. Looking
at tabbed.php example seems not to offer solutions .
Anyone can enlighten me?
Thanks,
--
Best regards,
Ing. Massimiliano Bariola Cell: ++39 329 3570098
REDLINK Italia S.a.s
http://www.redlinkitalia.it mailto:m.bariola@redlinkitalia.it
PGP Key:
http://www.redlinkitalia.it/PGP/MB_PGPKEY.txt