I want to dynamically add an HTML Helper instance to a form which has
been generated by crud.
I prefer to code it the Controller using the following snippet:
elif session.action == "update":
id=request.args[0]
mydict=dict(form=crud.update(db.testtable,id))
myINPUT=INPUT(_type='text', _id='testtable_testfield1',
_name='testfield1', value="abc", requires=IS_NOT_EMPTY())
form.components.append(myINPUT)
## We need a new method crud.appendComponent(myINPUT) since
form.components is not allowed...
return mydict
In the View I want to code something like:
<td>
{{ =myINPUT }}
</td>
When I run it, I get a runtime error indicating that the form variable
does not exist.
Is there anyway to access the components list directly, or should I
modify the crud class in tools.py
to have a new method to allow appending a component to the form that
crud owns?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---