Trying to generate a small form that is all buttons:

def month-example:
    months = {'January', 'February', 'March'}

    form = FORM()
    for month in months:
        # this fails
        form.add_button(month, URL(month))
    return dict(form=form)

This generates 'NoneType' object has no attribute 'parent'.

Creating links with helpers works:

        form += A( month, _href=URL(month) )

But the form is a dictionary, and the months are out of order. I think that add_button preserves the order, but have not verified that.

Does add_button only work with SQLFORM?

How can the order of elements added to a form programmatically be controlled?

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 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.

Reply via email to