John, I just counted one of my app, an order management system. The
order table has 45 fields. Here is what I did. I put them on the same
page so that all input data are validated together via the comfortable
form.accepts(...). The only downside is the default layout of SQLFORM
(...) for such a big table is long and boring, so I customized the
layout by manually organize a FORM(..) like this:
  form=FORM(TABLE(
    TR(INPUT(_name="first_field",...),INPUT
(_name='second_field',...)),
    TR(INPUT(_name="third_field",...),INPUT
(_name='fourth_field',...)),
    ....//you get the idea
  ))
  if form.accepts(...): db.orders.insert(**request.vars)

Eventually I got the layout looks great and works, although the
controller's code doesn't look compact.

This must not be the best approach. I plan to refactor it later,
hopefully I can define some Widgets and helpers to shorten the main
code.

Just for your reference.


On May6, 3:24am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I would suggest breaking the 60 fields over multiple tables (the way
> you want forms to look like) and link them using references.
> It will be much easier to handle it long term.
>
> Massimo
>
> On May 5, 12:02 pm, JohnMc <maruadventu...@gmail.com> wrote:
>
> > Working on another application. One table in the DAL will have about
> > 60 Fields in it. Using one long form would work but gets rather bland.
> > I would prefer to visually cut it up. I could either capture the data
> > in multiple screens for input or use a tabbed interface to capture the
> > data. I am leaning toward the tabbed interface.
>
> > The one approach I have considered for a tabbed approach is --
>
> > Controller:
>
> > Build the form using helper functions and pass as to dict()
>
> > View :
>
> > Set up the tabs, display the form and use jQuery hide(), show()
> > functions using onclick actions to display pieces of the form as
> > required.
>
> > I would be interested if there might be a better technique to consider
> > to achieve the same ends.
>
> > Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to