yes. that is a logic issue

form = SQLFORM(...)
form['_class']= '...'

{{=form}} renders for with new attributes

{{=form.custom.begin}} is a variable defined before the _class was
changed.

On Dec 21, 1:34 pm, Anthony <[email protected]> wrote:
> That method will work in general, but not with form.custom.begin and
> form.custom.end specifically. I guess we should make that clear in the book.
>
> Anthony
>
>
>
>
>
>
>
> On Wednesday, December 21, 2011 1:44:03 PM UTC-5, viniciusban wrote:
>
> > In web2py book, on chapter FORMS and VALIDATORS, section Forms and
> > Validators, it's written:
>
> > ---------------------------------------
> > FORM and SQLFORM are helpers and they can be manipulated in as similar
> > way as the DIV. For example you can set a form style:
>
> > 1. form = SQLFORM(..)
> > 2. form['_style']='border:1px solid black'
> > ---------------------------------------
>
> > I'm using this very way to set "_class" attribute and custom form to
> > show my form.
>
> > So, in my view I have:
> > {{=form.custom.begin}}
> >     {{=form.custom.label.nome}} {{=form.custom.widget.nome}} <br />
> > {{=form.custom.end}}
>
> > But the "_class" attribute isn't rendered.
> > I did a code trace and discovered the _xml() method is called at form
> > creation time. This way, the "_class" attribute is there, inside my
> > form instance, but it isn't showed in my view.
>
> > Is it a bug or a book mistake?
> > How can I use it?
>
> > --
> > Vinicius Assef.

Reply via email to