This is using the SQLFORM. What can i do if i want to add this link through the controller? I am creating the table in the controller, i think i have to put the widget here, but i dont know how. My controlles is this:
form=FORM(TABLE(
TD("Caracteristica"), TD(SELECT(_name="caracteristica",
*[OPTION(x.Caracteristica.nCaracteristica +' - '+ x.TipoCaracteristica.nTipoCaracteristica,_value=x.Caracteristica.id)
for x in db((db.Caracteristica.idTipoCaracteristica==db.TipoCaracteristica.id)&\
(db.Caracteristica.id.belongs(lista))).select(orderby=db.Caracteristica.nCaracteristica)])),
TD("Descripcion"),INPUT(_type='text',_name="descripcion"),
INPUT(_type='submit',_value='Submit')))
if form.accepts(request.vars, session):
if not form.vars.caracteristica=="":
db.CaracteristicaCientifico.insert(nCaracteristicaCientifico=form.vars.descripcion,
idCaracteristica=form.vars.caracteristica,idCientifico=session.idPrincipal)
redirect(URL(r=request, c='cientifico', f='insert', args=["db","CaracteristicaCientifico"]))
else:
form.errors.caracteristica ='Seleccionar un registro'
0
sophie 15 years ago