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
>
> 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
> 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
>
> # 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
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.
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
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
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
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
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
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
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
12 matches
Mail list logo