I guess, you will require to create a __toString or __string function which will return the name instead of id's for choice menus. Additionally check if you tables have some data to show in choice menus. the table which is available as choice data to other table should have some data or ___string function defined in projectRoot/lib/ model/***Peer.php class file.
I believe this will sort-out your problem. krishan On Aug 26, 3:57 pm, José Nahuel Cuesta Luengo <[email protected]> wrote: > Just guessing: are you dealing with complex primary keys on any propel- > choice-related table? I think you might be getting an array as an > index, when a simple string or number is actually expected. > > -- > José Nahuel Cuesta Luengo > > El 26/08/2009, a las 06:15, asim nizam <[email protected]> escribió: > > > here is my form code > > > class HrTblJobApplicationForm extends BaseHrTblJobApplicationForm > > { > > public function configure() > > { > > $this->setWidgets(array( > > 'application_id' => new sfWidgetFormInputHidden(), > > 'vacancy_id' => new sfWidgetFormPropelChoice > > (array('model' => 'HrTblJobVacancy', 'add_empty' => false)), > > 'lastname' => new sfWidgetFormInput(), > > 'firstname' => new sfWidgetFormInput(), > > 'middlename' => new sfWidgetFormInput(), > > 'street1' => new sfWidgetFormInput(), > > 'street2' => new sfWidgetFormInput(), > > 'city_id' => new sfWidgetFormPropelChoice > > (array('model' => 'Cities', 'add_empty' => true)), > > 'country_code' => new sfWidgetFormPropelChoice > > (array('model' => 'Countries', 'add_empty' => true)), > > 'province' => new sfWidgetFormInput(), > > 'zip' => new sfWidgetFormInput(), > > 'phone' => new sfWidgetFormInput(), > > 'mobile' => new sfWidgetFormInput(), > > 'email' => new sfWidgetFormInput(), > > 'qualifications' => new sfWidgetFormInput(), > > 'status' => new sfWidgetFormInput(), > > 'applied_timestamp' => new sfWidgetFormDateTime(), > > 'emp_number' => new sfWidgetFormInput(), > > 'inter_panel_code' => new sfWidgetFormPropelChoice > > (array('model' => 'HrTblPanels', 'add_empty' => true)), > > 'created_by' => new sfWidgetFormPropelChoice > > (array('model' => 'Users', 'add_empty' => true)), > > 'created_when' => new sfWidgetFormInputHidden > > (array('default' => date('Y/m/d H:i', time()))), > > 'modified_by' => new sfWidgetFormPropelChoice > > (array('model' => 'Users', 'add_empty' => true)), > > 'modified_when' => new sfWidgetFormInputHidden > > (array('default' => date('Y/m/d H:i', time()))), > > 'hr_tbl_app_education_list' => new sfWidgetFormPropelChoiceMany > > (array('model' => 'HrTblEducation')), > > )); > > $this->widgetSchema->setLabels(array( > > 'vacancy_id' => 'vacancy_id', > > 'lastname' => 'Last Name', > > 'firstname' => 'First Name', > > 'middlename' => 'Middle Name', > > 'street1' => 'Street1', > > 'street2' => 'Street2', > > 'city_id' => 'City', > > 'country_code' => 'Country', > > 'province' => 'Province', > > 'zip' => 'Zip Code', > > 'phone' => 'Phone', > > 'mobile' => 'Mobile', > > 'email' => 'Email', > > 'qualifications' => 'Qualifications', > > 'status' => 'Status', > > 'applied_timestamp' => 'Applied_timestamp', > > 'emp_number' => 'Employee Number', > > 'inter_panel_code' => 'inter_panel_code', > > > )); > > $this->setValidators(array( > > 'application_id' => new sfValidatorPropelChoice > > (array('model' => 'HrTblJobApplication', 'column' => > > 'application_id', 'required' => false)), > > 'vacancy_id' => new sfValidatorPropelChoice > > (array('model' => 'HrTblJobVacancy', 'column' => 'vacancy_id')), > > 'lastname' => new sfValidatorString(array > > ('max_length' => 100)), > > 'firstname' => new sfValidatorString(array > > ('max_length' => 100)), > > 'middlename' => new sfValidatorString(array > > ('max_length' => 100)), > > 'street1' => new sfValidatorString(array > > ('max_length' => 100, 'required' => false)), > > 'street2' => new sfValidatorString(array > > ('max_length' => 100, 'required' => false)), > > 'city_id' => new sfValidatorPropelChoice > > (array('model' => 'Cities', 'column' => 'id', 'required' => false)), > > 'country_code' => new sfValidatorPropelChoice > > (array('model' => 'Countries', 'column' => 'id', 'required' => > > false)), > > 'province' => new sfValidatorString(array > > ('max_length' => 100, 'required' => false)), > > 'zip' => new sfValidatorString(array > > ('max_length' => 20, 'required' => false)), > > 'phone' => new sfValidatorString(array > > ('max_length' => 20, 'required' => false)), > > 'mobile' => new sfValidatorString(array > > ('max_length' => 20, 'required' => false)), > > 'email' => new sfValidatorString(array > > ('max_length' => 50, 'required' => false)), > > 'qualifications' => new sfValidatorString(array > > ('max_length' => 200, 'required' => false)), > > 'status' => new sfValidatorInteger(array > > ('required' => false)), > > 'applied_timestamp' => new sfValidatorDateTime(array > > ('required' => false)), > > 'emp_number' => new sfValidatorInteger(array > > ('required' => false)), > > 'inter_panel_code' => new sfValidatorPropelChoice > > (array('model' => 'HrTblPanels', 'column' => 'panel_code', > > 'required' => false)), > > 'created_by' => new sfValidatorPropelChoice > > (array('model' => 'Users', 'column' => 'id', 'required' => false)), > > 'created_when' => new sfValidatorDateTime(array > > ('required' => false)), > > 'modified_by' => new sfValidatorPropelChoice > > (array('model' => 'Users', 'column' => 'id', 'required' => false)), > > 'modified_when' => new sfValidatorDateTime(array > > ('required' => false)), > > 'hr_tbl_app_education_list' => new sfValidatorPropelChoiceMany > > (array('model' => 'HrTblEducation', 'required' => false)), > > )); > > > $this->widgetSchema->setNameFormat('hr_tbl_job_application[%s]'); > > > $this->errorSchema = new sfValidatorErrorSchema($this- > > >validatorSchema); > > } > > } > > > On Wed, Aug 26, 2009 at 3:01 PM, Sid Bachtiar > > <[email protected]> wrote: > > > What's your form code like? > > > On Wed, Aug 26, 2009 at 8:59 PM, Krishan .G<[email protected]> > > wrote: > > > Problem might be somewhere in \lib\form\ and model's form base > > class file. > > > check if $this->setWidgets() function is provided with > > appropriate choice > > > widget. May be this can help.. > > > > On Wed, Aug 26, 2009 at 2:15 PM, sunny <[email protected]> wrote: > > > >> I get the following error message in the form! > > >> Warning: Illegal offset type in /var/www/civil/lib/vendor/symfony/ > > lib/ > > >> plugins/sfPropelPlugin/lib/widget/ > > sfWidgetFormPropelChoice.class.php > > >> on line 105 > > > -- > > Blue Horn Ltd - System Development > >http://bluehorn.co.nz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
