Forum OpenACS Development: Re: Forms/Metadata Part Two

Collapse
Posted by Barry Books on
Addresses are a big problem. If you pick the country first then go to a page to fill in an address it's easy enough, just make a US address datatype and a Canada address datatype. If you what to switch interfaces without a trip the the server then things are much more complicated. I guess you could include both and javascript the visiblity.

Multifield validation is a problem also. On my current project I do single field automatically and multifield with custom code. This works pretty well but I don't do much multifield validation.

Collapse
Posted by Jeff Davis on
Barry, the having a canada address datatype and us address datatype is at odds with how address datamodels are written. generally you conflate state/province into one field and either have a different form for the two or you validate state/province based on country.

My point is more that it's not necessarily a good idea to presume a single widget for a given field will be adequate. Certainly for a basic "one size fits all" rapid prototype the generic interface it will be ok but cms has something almost exactly like this already (with the added bonus of the ability to populate widget params from the db or evaled tcl code) and it is not up to the job for real forms either.

Also, on one to many I suspect it would be better to just create tables for the 1-N types rather than a table with a union of all possible data types in it. there is a table field in the acs_attributes table already for that purpose.