Re: FormBuilder custom select

From: Date: Mon, 19 Sep 2005 08:04:29 +0000
Subject: Re: FormBuilder custom select
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21040@lists.php.net to get a copy of this message
Il 19:36, venerdì 16 settembre 2005, Justin Patrin ha scritto: > On 9/16/05, Alessandro Pasotti <ale.pas@tiscali.it> wrote: > > Hello, > > Sould be like this: > > > > ------------------------------------------- > > Client: [Choose one...V] or [New value]* > > [Client 1 ] > > [Client 2 ] > > ------------------------------------------- > > > > * This opens the popup > > I recommend doing what I did for FormBuilder. Create your own HTML_QF > element which adds the button and the JS for the button which opens > the new window, then have a special script which displays the form for > the new element and includes the JS to re-inject the option into the > opener's select. If you need help building a new QF element check out > the stuff in DB/DataObject/FormBuilder/QuickForm/. Then ask here if > you still need help. Hello Justin, thank you for your guidance, this is what I've done so far: - subclass HTML_QuickForm_select (registered as 'sigselect') and add the button - add some code in DO preGenerateForm(): $_el = &HTML_QuickForm::createElement('sigselect', $k, $k, $options, array('onclick'=>'"window.open(\'' . $_href .'\')"')); $this->fb_preDefElements[$k] = &$_el ; Now the problem: how to populate the options in the select? Normally FormBuilder does it automatically for you taking care of links, but that don't seem to work with preDefElements. Is there a way to use FormBuilder routines also with preDefElements? Regards. -- Alessandro Pasotti ICQ# 245871392 Linux User #167502 -- Alessandro Pasotti ICQ# 245871392 Linux User #167502

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