My implementation is about as simple as it could possibly get and works for my purposes. Actually, looking at that thread you pointed to me, it's exactly the same as the implemention posted by jphilip.
Of course, if it's actually a real field and not a calculated field you'll have problems because the data doesn't actually get passed, which means the form will blank out the field whenever you save. But maybe this could be fixed by using that 'readonly' option mentioned in the thread? On Sun, Dec 28, 2008 at 5:15 AM, Fabian Lange <[email protected]> wrote: > > Hi, > there is a Ticket about this as well, > http://trac.symfony-project.org/ticket/5296 > > however I think the description at the end of this topic might be good > enough: > http://www.symfony-project.org/forum/index.php/m/65161/ > > If you have a simple Plain implementation we might talk fabien in > approving this for 1.2, otherwise it can come earliest in 1.3 > > Fabian > > > On Dec 28, 2008, at 9:34 AM, David Brewer wrote: > >> >> To anyone who might be interested in how I managed this, I ended up >> implementing my own widget class for this purpose called >> "sfWidgetFormPlain.class.php". It extends sfWidgetForm, and overrides >> the render method to just return the value. Worked perfectly for what >> I need. >> >> I'm ccing the dev list to see if there is any interest in this as a >> feature there. What do you think? Is this a use case that comes up >> often enough that a widget for this purpose would be useful? >> >> On Sat, Dec 27, 2008 at 3:20 PM, David Brewer >> <[email protected]> wrote: >>> I sometimes need to display a value in a form field which is not >>> editable but purely informational. For example, imagine a user class >>> with separate fields for first name, last name, middle name, title, >>> etc... I like to have an additional field "display name" which is a >>> custom getter that returns the formatted combination of those names. >>> In my admin console I need to display this field as plain text so the >>> user can see what they have done, but as it is generated it should >>> not >>> be editable. >>> >>> Under the sf 1.0 admin generator I could do this with a "type: plain" >>> setting in generator.yml. What is the preferred way to handle this >>> situation using the new admin generator and forms framework? >>> >>> Thanks, >>> >>> David Brewer >>> [email protected] >>> >> >> > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
