I've made population by hand - using setDefault method, but it doesn't
seem natural. When I save the form, the empty embedded form returns
with errors: "xxxField required"...
Just don't get it - why aren't they autopopulated???
On 8 дек, 16:10, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi guys, I'm using symfony 1.2 and Propel, and I have the problem with
> autopopulation of embedded forms. They are saved correctly, but when
> displayed they are empty. Here is the code:
>
> //schema.yml
> propel:
> # it is resume of emploee
> seeker_resume:
> _attributes: { idMethod: native }
> id: { type: INTEGER, required: true, primaryKey: true,
> autoIncrement: true, unsigned:true }
> user_id: { type: integer, foreignTable: sf_guard_user,
> foreignReference: id, required: true, onDelete: cascade }
> sector_id: { type: integer, foreignTable: sector,
> foreignReference: id, onDelete: cascade }
> position: { type: varchar(255), required: true }
> currency: { type: varchar(10), required: true }
> salary: { type: integer, required: true }
> schedule: { type: varchar(100), required: true }
> city_live_id: { type: integer, foreignTable: city,
> foreignReference: id, onDelete: cascade, required: false }
> seek_job_in_native_city: { type: varchar(3), required: false }
> ready_to_move: { type: varchar(3), required: false }
> experience: { type: varchar(100), required: true }
>
> # it is the description of emploee's experience
> resume_experience:
> _attributes: { idMethod: native }
> id: { type: INTEGER, required: true, primaryKey: true,
> autoIncrement: true, unsigned:true }
> seeker_resume_id: { type: integer, foreignTable: seeker_resume,
> foreignReference: id, onDelete: cascade }
> user_id: { type: integer, foreignTable: sf_guard_user,
> foreignReference: id, required: true, onDelete: cascade }
> company_name: { type: varchar(100), required: true }
> start_date: { type: timestamp, sqltype:datetime }
> end_date: { type: timestamp, sqltype:datetime }
> post: { type: varchar(255), required: true }
> description: { type: longvarchar, required: true }
>
> public function executeEdit($request)
> {
> $seekerResume = SeekerResumePeer::retrieveByPk($request-
>
> >getParameter('id'));
>
> $this->form = new SeekerResumeForm($seekerResume);
>
> $experiences = $seekerResume->getResumeExperiences();
>
> foreach($experiences as $experience) {
>
> $experienceForm = new ResumeExperienceForm($experience);
>
> $this->form->embedForm('experienceForm-' .
> $experience->getId(),
> $experienceForm);
> }
>
> if ($request->isMethod('post'))
> {
> //here is saving
> ...........................
> }
> }
>
> What am I doing wrong? Any hints will be much appreciated...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---