Yah, I tried the Enter key, and a lot of other combinations of control 
and/or shift + enter as well as an abracadabra (on Chrome (didn't try any 
other browser)), but none of them got the list:string to represent except 
as a single string field. No additional string fields magically appeared, 
as hoped for.

I think a stronger widget is needed for this very useful construct. I use 
list:string in lots of places and having a handy way of editing them is 
essential. Obviously, not being able to delete a string after entry makes 
any list:string editor DOA. (Needs an (x) button at end of string field 
that, if clicked, prompts user to confirm delete & then deletes field from 
form and db entry when submitted.

I will submit a formal enhancement request, if it hasn't already been done.

Thanks for the tip on IS_LIST_OF. Must print out & read doc again one of 
these days.


On Monday, July 9, 2012 11:11:53 PM UTC+8, Anthony wrote:
>
> Well, by default, the list:string field type does get a special Javascript 
> widget, though the functionality could probably be improved. After you 
> enter an item in the initial text box, hit enter, and a new box should 
> appear below it, and so on. There is no way to remove a box once created.
>
> Regardless of the widget, you can apply an email validator to each item in 
> a list:string input using IS_LIST_OF(IS_EMAIL()). The only caveat is that 
> validation errors will not automatically be displayed on the form, so you 
> have to explicitly check for a validation error on that field and implement 
> a custom error display.
>
> Anthony
>
> On Monday, July 9, 2012 10:15:34 AM UTC-4, weheh wrote:
>>
>> This has been an oft-disucssed topic. Just search for "list:string crud" 
>> But having just experienced the pain myself, and not easily locating the 
>> status of this issue, I felt compelled to ask for myself: 
>>
>> Shouldn't list:string have a default interactive (jQuery OK) widget that 
>> is an expandable/collapsible list of user-input text data that works with 
>> crud? Validators like IS_EMAIL() would then have to iterate on list:string. 
>> This would be handy for storing entities with multiple emails, for example.
>>
>> Seems like a gap in web2py's form-input armor and a pretty useful 
>> capability, to boot. So what's the latest?
>>
>

Reply via email to