[Product-Developers] dexterity [newbie] : how to disable a Field widget

thomas desvenain thomas.desvenain at gmail.com
Sat Nov 12 20:51:41 UTC 2011


I agree that's not a so uncommon usecase.
Often, some fields in 'edit' forms can't be modified once 'add' for has
been submited, and many users prefer display them as 'disabled' than in
'display' or 'hidden'
Sometimes you need to see exactly what you can't set because of the context
(your roles, the step of content edition...)

I think it's a kind of widget 'mode'. In my way the better way to deal with
that would be adding a 'DISABLED' widget mode (that could be set up in the
setupWidgets when necessary)



On Sat, Nov 12, 2011 at 6:35 AM, T. Kim Nguyen <nguyen at uwosh.edu> wrote:

> Hi David - we've had that particular use case a few times here: we want to
> populate a student ID field but don't want the student to be able to change
> it, while a staff member filling out the object on behalf of the student
> might need to change it.
>
>        Kim
>
> On Nov 11, 2011, at 11:25 PM, David Glick wrote:
>
> > On 11/9/11 1:16 AM, gnafou wrote:
> >> Hello,
> >>
> >> 1/Developping my first dexterity product, i've been trying to 'disable'
> a field widget .. but could not find how ( i have default values that
> should be visible but must not be changed )
> >> maybe i should do that with a specific css style ??
> > I don't think Dexterity has support for this without creating a
> customized widget. It seems like an unusual use case to me. Why do you need
> to show something without letting the user change it?
> >
> > One way to do it would be with javascript when the page loads.
> >> 2/ I was wondering if it s possible to add an html paragraph in the
> body of the form
> > You can use HTML in field descriptions. Otherwise you need to create a
> custom edit form (see Dexterity manual) and customize the template.
> >
> > cheers,
> > David
> >
> >
> > ----------
> > David Glick
> > Web Developer
> > davidglick at groundwireconsulting.com
> > 206.286.1235x32
> >
> > Groundwire Consulting is here.
> >
> > http://groundwire.org/about/FAQ-gw-consulting
> >
> >
> > _______________________________________________
> > Product-Developers mailing list
> > Product-Developers at lists.plone.org
> > https://lists.plone.org/mailman/listinfo/plone-product-developers
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> https://lists.plone.org/mailman/listinfo/plone-product-developers
>



-- 
Thomas Desvenain

Téléphone : 09 51 37 35 18
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20111112/c2b84235/attachment.html>


More information about the Product-Developers mailing list