[web2py] Re: Static form control in case of read only field

2014-01-21 Thread Anthony
On Tuesday, January 21, 2014 11:27:25 AM UTC-5, Annet wrote: > > > That doesn't look like it will work -- the first branch will only execute >> if controls is an instance of all three types of widgets, which will never >> be true. I think you want: >> >> if not isinstance(controls, (INPUT, SELECT

[web2py] Re: Static form control in case of read only field

2014-01-21 Thread Annet
> > Regarding the flash message position, here attached you'll find the > patched files of my package. Now the default position is on the rightside > but by adding in layout.html to the flash dom element the css class > "centered" it will horizontally centered on the page or by adding the css

[web2py] Re: Static form control in case of read only field

2014-01-21 Thread Annet
> That doesn't look like it will work -- the first branch will only execute > if controls is an instance of all three types of widgets, which will never > be true. I think you want: > > if not isinstance(controls, (INPUT, SELECT, TEXTAREA)): > > No it didn't work :-) clicking through some for

[web2py] Re: Static form control in case of read only field

2014-01-21 Thread Anthony
> > # embed _help into _controls > if not (isinstance(controls, INPUT) and isinstance(controls, SELECT) and > isinstance(controls, TEXTAREA)): > _controls = DIV(P(controls, _help, _class='form-control-static'), > _class='col-sm-6 controls') > else: > _controls = DIV(controls, _help, _cl

[web2py] Re: Static form control in case of read only field

2014-01-21 Thread Annet
Hi Paolo, About the checkboxes and radio controls please note that the package works > since Version 2.8.2-stable+timestamp.2013.12.17.16.49.17 of web2py. In the > previous versions the related widget > I downloaded web2py version 2.8..2 for normal users and for testers both are: Version 2.8.

[web2py] Re: Static form control in case of read only field

2014-01-21 Thread Annet
Hi Anthony, This line: > > _controls = DIV(controls, _help, _class='col-sm-6 controls') > > puts the content inside the DIV in question. If you don't want that in > case of read-only fields, you'll need to first check whether "controls" is > a form widget (i.e., input, select, or textarea), and

[web2py] Re: Static form control in case of read only field

2014-01-20 Thread Paolo Caruccio
Annet, thank you for your comments. About the checkboxes and radio controls please note that the package works since Version 2.8.2-stable+timestamp.2013.12.17.16.49.17 of web2py. In the previous versions the related widget code in gluon/sqlhtml.py was different. For the other suggestions, I found

[web2py] Re: Static form control in case of read only field

2014-01-20 Thread Anthony
This line: _controls = DIV(controls, _help, _class='col-sm-6 controls') puts the content inside the DIV in question. If you don't want that in case of read-only fields, you'll need to first check whether "controls" is a form widget (i.e., input, select, or textarea), and don't wrap it in the D

[web2py] Re: Static form control in case of read only field

2014-01-20 Thread Annet
Hi Paolo, Thanks for your reply. I added the following lines of code to my bootstra3 function if isinstance(controls, basestring): # string controls = P(controls, _class='form-control-static') elif isinstance(controls, INPUT): if controls['_ty

[web2py] Re: Static form control in case of read only field

2014-01-20 Thread Paolo Caruccio
Hi Annet, in your bootstrap3 function, you should check if "controls" is an instance of string, number or SPAN and change the controls layout as you want. For more details you could see the "build_row" function in the attached module (search for "form-control-static"). If you are interested

[web2py] Re: Static form control in case of read only field

2014-01-20 Thread Annet
Hi Anthony, Thanks for your reply. I have a table named register: db.define_table('register', Field('nodeID', 'reference node', writable=False, readable=False), Field('interfaceCategoryID', 'reference interface_category', writable=False, readable=False), ... migrate=False) In

[web2py] Re: Static form control in case of read only field

2014-01-19 Thread Anthony
How is your form code currently being generated? On Sunday, January 19, 2014 6:51:36 AM UTC-5, Annet wrote: > > In a registration form I want a field to be read only, so I set > > db.register.interfaceCategoryID.writable=False > db.register.interfaceCategoryID.default=interfaceCategoryID > > In th