Db_DataObject and Formbuilder virtual fields

From: Date: Fri, 22 Jul 2005 16:04:13 +0000
Subject: Db_DataObject and Formbuilder virtual fields
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20099@lists.php.net to get a copy of this message
whats wrong with this?!?!??!? if you make a virtual field in the DataObject and try in the callback function preGenerateForm to make the preDefElemet it did not apper when form->display() is called why?!? her is the code. function table() { return array_merge(parent::table(), array('virtualField' => DB_DATAOBJECT_INT)); } //stop the virtual field from being in the INSERT function insert() { if (isset($this->virtualField)) { unset($this->virtualField); } parent::insert(); } //stop the virtual field from being in the UPDATE function update($do = false) { if (isset($this->virtualField)) { unset($this->virtualField); } if (is_object($do) && isset($do->virtualField)) { unset($do->virtualField); } parent::update($do); } function preGenerateForm( &$fb ) { $nr[0]="text1"; $nr[1]="text2"; $this->fb_preDefElements['virtualField'] = HTML_QuickForm::createElement('select', 'virtualField','News Kategorie',$nr); }

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