Hey Sid,

I would not rely on the generator.yml to configure which form fields
are displayed, since it only hides fields from the interface.. as far
as the form is concerned you end up with empty form fields if a field
is not displayed and the form is submitted.
As shown above the solution is to handle this inside the form class,
based on whether the object is new or not..

Hope this helps,
Daniel


On Aug 27, 4:36 pm, Sid Bachtiar <sid.bacht...@gmail.com> wrote:
> A bit more info, my schema:
>
>   email_banner:
>     id: { type: integer, primaryKey: true, autoIncrement: true }
>     image: { type: varchar(255), required: true, unique: true }
>     descr: { type: longvarchar }
>     is_active: { type: boolean, required: true, default: true }
>     created_at:
>
> When I edit, I want to only edit descr and is_active. I put this in
> the generator.yml:
>
> edit:
>   display: [descr, is_active]
>
> I displayed correctly but would not save.
>
> On Fri, Aug 28, 2009 at 10:25 AM, Sid Bachtiar<sid.bacht...@gmail.com> wrote:
> > Hi all,
>
> > I'm trying to understand the new admin generator for Symfony 1.2
>
> > I have a field 'image', and I don't want people to edit it, only when
> > inserting new record.
>
> > Do I have to create separate form class for this?
>
> > --
> > Blue Horn Ltd - System Development
> >http://bluehorn.co.nz
>
> --
> Blue Horn Ltd - System Developmenthttp://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 symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to