[Grok-dev] Dependent choice fields with formlib

Santiago Videla santiago.videla at gmail.com
Thu Sep 18 19:04:01 EDT 2008


Hi Sebastian

I don't get it

Why should works that? looking at the code, I understand that choice fields
always run the _validate() function before any custom validate, constraint
or invariant. And that function, raise an exception if the selected value is
not in the initial vocabulary.

Anyways, I added the default value, but nothing changed

cheers

On Thu, Sep 18, 2008 at 1:53 PM, Sebastian Ware <sebastian at urbantalk.se>wrote:

> I am guessing here, but I think you can add a
>
>  default="xyz"
>
> to your choice field, and then allways have an item in values that
> corresponds to xyz (such as "Select one...")
>
> Mvh Sebastian
>
> 18 sep 2008 kl. 17.07 skrev Santiago Videla:
>
>  Hi,
>>
>> I'm trying to make a custom search form using formlib
>>
>> In that form I have 1 select (schema.choice) that depends on another
>> select field, and using KSS when one changes the other is updated (for
>> example, country and city)
>>
>> My interface is something like this
>>
>>   master = schema.Choice(title='Master field',
>> vocabulary='some.registered.vocabulary')
>>   slave = schema.Choice(title='Slave field', values=['Select one...',])
>>
>> But when the slave field it's update using KSS, the submit action give me
>> an "Invalid Input" error in the slave field.
>>
>> I guess that this is because, the values updated does not belong to the
>> list of values (['Select one...'])
>>
>> How should I tackle this?
>>
>> thanks in advance
>>
>>
>> --
>> Santiago Videla
>> www.revolucionesweb.com.ar
>> http://www.linkedin.com/in/svidela
>>
>> Sigue la mata dando de que hablar siempre abajo y a la izquierda donde el
>> pensamiento que se hace corazón resplandece con la palabra sencilla y
>> humilde que l at s tod at s somos.
>> _______________________________________________
>> Grok-dev mailing list
>> Grok-dev at zope.org
>> http://mail.zope.org/mailman/listinfo/grok-dev
>>
>
>


-- 
Santiago Videla
www.revolucionesweb.com.ar
http://www.linkedin.com/in/svidela

Sigue la mata dando de que hablar siempre abajo y a la izquierda donde el
pensamiento que se hace corazón resplandece con la palabra sencilla y
humilde que l at s tod at s somos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20080918/0590e707/attachment.html 


More information about the Grok-dev mailing list