Em Wed, 26 Aug 2009 21:14:01 -0300, sparqle <[email protected]> escreveu:

Hi,

Hi!

I would like to understand how to create dynamic forms and grids in T5.

T5 is all about static structure, dynamic behaviour.

Now I would like to store all of item types (book, car, tv etc.) in 1 database
table called "itemtypes", and all the attributes in one database table
called "attributes". Both these tables are linked by a many-to-many
relationship. I will create another table called "items", where the
individual items are stored ("Gone with the wind", "Lord of the Rings"
etc.). I will create another table called "itemAttributeValues" where the
values for the attributes for each item will be stored ("Gone with the wind" - 900 pages, "Margaret Mitchell", 1937).

I'm sorry to be so sincere, but this kind of database approach is absolutely awful. Something awful enough to appear in TheDailyWTF.com (if it wasn't featured there already). Tapestry 5 has BeanEditForm, BeanEditor, Grid and BeanDisplay, all them time-savers when writing a form or grid or object view, but they only work if you provide them decently-modelled entity classes (a Book class with title and author properties, a DVD class with title and director properties).

Can anybody help me here?? I assume this must be a common requirement in
many systems!!

This is already implemented in Tapestry 5, as long as you have decently-modelled classes. Take a look at the documentation of the components cited above and the BeanEditor or BeanEditForm examples in http://jumpstart.doublenegative.com.au:8080/jumpstart/.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to