Right now, it passes TD(widget, _class='w2p_fw') to the lambda, but Ray 
would prefer it simply pass widget to the lambda so he can wrap the widget 
and the comment in a single TD (I think). I guess the downside of that is 
you lose the automatic class assignment (though maybe it could go in a div 
or span instead). I wonder if it would make more sense for the lambda 
option to work more like formstyle='divs' -- no outer wrapper (i.e., no 
TABLE or UL), and just let the lambda function produce the appropriate 
markup for each input field "row".

Anthony

On Saturday, December 24, 2011 11:40:31 AM UTC-5, Massimo Di Pierro wrote:
>
> I agree but it ugly but it is actually more poweful because you have 
> access to the entire widget as opposed to only one of its components. 
> I think we should live this one alone. 
>
> On Dec 24, 8:58 am, Anthony <[email protected]> wrote: 
> > I agree, but may be a backward compatibility issue (though I suspect 
> usage 
> > of the lambda option is quite rare). 
> > 
> > Anthony 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Saturday, December 24, 2011 4:39:58 AM UTC-5, Ray (a.k.a. Iceberg) 
> wrote: 
> > 
> > > Hi Massimo, 
> > 
> > > I just discovered the lovely formstyle=lambda ... feature. (http:// 
> > > web2py.com/books/default/chapter/29/7?search=formstyle) 
> > 
> > > It saves me from the headache of css. However, it is strange that the 
> > > value of "field_widget" parameter is a TD instance. Should it better 
> > > be a raw widget instance? 
> > 
> > > Example. Right now I have to use the ugly ".comonents[0]" notation: 
> > 
> > >     crud.settings.formstyle = lambda record_id, field_label, 
> > > field_widget, field_comment: TR( 
> > >         field_label, DIV(field_widget.components[0], field_comment)) 
> > 
> > > I prefer: 
> > 
> > >     crud.settings.formstyle = lambda record_id, field_label, 
> > > field_widget, field_comment: TR( 
> > >         field_label, DIV(field_widget, field_comment)) 
> > 
> > > If you like this idea, tell me to open an issue to track its progress. 
> > 
> > > Regards, 
> > > Ray

Reply via email to