Hey,
I was hoping someone could help me understand what I'm doing wrong.
For some reason, in my SQLFORM.factory created form, even though I had
specified formstyle='divs' and everything else was inside divs, my radio
buttons were still being rendered inside a table.
Which I found odd since in sqlhtml.RadioWidget code one can see:
#widget style
wrappers = dict(
table=(TABLE, TR, TD),
ul=(DIV, UL, LI),
divs=(CAT, DIV, DIV)
)
parent, child, inner = wrappers[attributes.get('style', 'table')]
On closer inspection the attributes to the widget were always going empty.
After losing a bit of time trying to understand why, I decided to do this
hammertime style code
from functools import partial # HAMMERTIME!
divs_radio_widget = partial(SQLFORM.widgets.radio.widget, style='divs')
And this is what I used as a widget. Which solved the problem, of course,
but I would like to know why isn't the widget getting the style, is it by
design or something I may be doing wrong?
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.