Forum OpenACS Development: Re: Forms/Metadata Part Two

Collapse
Posted by Barry Books on
I think we mostly agree but I think I see your problem. BTW I like CMS, it just does not seem useful for auto generating a bunch of admin forms.

Addresses are a good example because I think it's possible to have one datamodel to store most addresses, but you need multiple user interfaces depending on local or user preferences. In my case I need to collect US and Canada addresses. Some people need to enter either. Some people only want to enter US and don't want a country box. Some want ZIP+4 others want full state names and still others want the two character states.

If you build a address object with a generic data model then build a US address object with a supertype of address then you should be able to override the state attribute with an enum list of the 50 US states but still store the data in the generic tables.

How the whole UI works is a different problem because you would want an address widget to display/collect the data. It might be possible in some cases to rework the UI based on the datatype but in the general case I think you would need custom widgets for most datatypes.

I don't really see this as way to auto generate all forms and save code. I actually like the ad_page_contract model with pluggable filers and call address_widget to get the html form, but users like the ever forward, error by the input box model of the form templates. This has been a constant battle for me so I started moving to form templates but it seems like the pieces don't quite fit together. Just looking thru the code it seems only a few packages use the form templates, what feedback to other people have about the press back to fix your errors interface? Of couse I just hit back to fix some mistakes and my browser presented me with a black form.