>
> I can't find any documentation of the hideerror feature, but looking at 
> html.py, I don't see how the above example would work:
>
> INPUT( _type='radio', _name='age', _value='5', _id='age5', 
> hideerror=True,value
> =self.request.vars['age'])
>

That should work. Note, INPUT inherits from DIV, and all named arguments to 
a DIV get added to the .attributes attribute (
http://code.google.com/p/web2py/source/browse/gluon/html.py#630). DIV also 
overrides the __getitem__ method (
http://code.google.com/p/web2py/source/browse/gluon/html.py#687), so 
input['hideerror'] will retrieve the hideerror attribute from 
input.attributes (i.e., it is equivalent to input.attributes['hideerror']). 
Finally, the hideerror attribute is retrieved during serialization in the 
INPUT.xml() method: 
http://code.google.com/p/web2py/source/browse/gluon/html.py#1661.
 

> The hideerror flag seems to work if you do this, though:
>
> input = INPUT( _type='radio', _name='age', _value='5', _id='age5', value=
> self.request.vars['age'])
> input['hideerror'] = True
>
> I see nothing that transfers the hideerror argument from the constructor 
> to a property of the input object, where it needs to be during 
> serialization. What's the correct use of hideerror and where is it 
> documented?
>

Unfortunately, it appears hideerror as an argument to INPUT() is not 
documented in the book, though its use as an argument to forms is 
documented in the forms chapter: 
http://web2py.com/books/default/chapter/29/7#keepvalues, 
http://web2py.com/books/default/chapter/29/7#Hide-errors.

Anthony

Reply via email to