I have installed the color picker widget for web2py.
I am trying to use multiple color pickers in a single form and I am getting unwanted repeats of the widget - 10 on the page instead of 4.
Here is my table definition from model.py
db.define_table('config',
Field('width', 'decimal(10,6)'),
Field('height', 'decimal(10,6)'),
Field('plot_color_1', 'string', widget=color_widget.widget),
Field('plot_color_2', 'string', widget=color_widget.widget),
Field('plot_color_3', 'string', widget=color_widget.widget),
Field('plot_color_4', 'string', widget=color_widget.widget),
auth.signature,
migrate=True,
)
Here is controller, config.py
def edit():
record = db.config(1)
fields = (
db.config.id,
db.config.width,
db.config.height,
)
form = SQLFORM(db.config, record,
#fields=fields,
showid=False)
if form.process().accepted:
response.flash = 'form accepted'
elif form.errors:
response.flash = 'form has errors'
else:
response.flash = 'please fill out the form'
return dict(form=form)
And the resulting output.
Can someone suggest a workaround?