Re: QFC : How to pass navigation parameters to each page?

From: Date: Fri, 14 Nov 2003 13:50:17 +0000
Subject: Re: QFC : How to pass navigation parameters to each page?
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8936@lists.php.net to get a copy of this message
I must add a note here. If all the pages of a multi-page form contain the same set of navigational elements (in my case elements "section" and "pageid"), the controller will squeak because the same element is added more than once. I seem to have solved this problem by setting constant elements in the controller: $wizard =& new HTML_QuickForm_Controller( "gromit" ) ; $nav = array( "pageid" => "101", "section" => 2 ) ; $wizard->setConstants( $nav ) ; // Then add pages - each buildForm() will contain "pageid" and "section" elements Then each of your page in display() mode can repeatedly pass the "pageid" and "section" elements without risk of collision. I would be glad if someone knowledgeable could confirm that this is intended behaviour of the setConstants() method. Thanks _________________________ "Ignatius Reilly" <ignatius.reilly@free.fr> wrote in message news:20031114112557.15203.qmail@pb1.pair.com... > Many thanks Alexey. > Your suggestion worked very nicely > > _________________________ > "Alexey Borzov" <borz_off@cs.msu.su> wrote in message > news:3FB496BD.1030208@cs.msu.su... > > Hi! > > > > Ignatius Reilly wrote: > > > I am trying to build a multi-page form. My specific constraint is that > each > > > page action must pass the two navigational parameters so that the > correct > > > script is called. > > > No problem when action is "display" or "submit". However, when > (defaulted) > > > action is "jump", the page is called by a GET request, which passes only > the > > > action button. So I can not pass the navigational parameters. > > > > > > My question: > > > - what is the easiest way to handle this issue? > > > > > > before I embark into uncharted waters, like: > > > - extending the HTML_QuickForm_Action_Jump class so that it passes the > > > navigational parameters in cURL/ POST mode? > > > - customizing the HTML_QuickForm_Action_Jump class ? > > > > > > Any idea will be welcome. > > > > I'd suggest creating a custom class based on HQA_Jump code, which will > pass the > > additional parameters as well. Then just do > > $controller->addAction('jump', new CustomJump()); > > > > Alternatively, you could pass the navigational parameters in container(), > but I > > presume that you need these parameters before the Controller kicks in...

« previous php.pear.general (#8936) next »