Hi, I would like to understand how to create dynamic forms and grids in T5. For example, suppose I am trying to build a site like Amazon.com with lot of items for sale (including books, tvs, computers etc.). Each type of item may have its own set of attributes - books (author, number of pages, publication year, isbn etc.), tv (brand, refresh rate, crt/lcd/plasma, size etc.). 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).
Now I would like to provide some forms for the users to edit/input this information, and some grids to view this information. I obviously don't want to create a separate form/grid for each "item type" as there may be hundreds of such categories. What I want is to store the "UI Component" associated with each attribute in the database, and then display dynamic forms based on this, depending on the specific item being viewed/edited. The "UI Component" could be numeric (integer/double etc.), textfield, select, checkbox/radio, or date. So the end effect should be: If user goes to url: http://mydomain.com/item/edit/1 - a list of controls may be presented that are relevant to that item, and may be completely different from the controls displayed on http://mydomain.com/item/edit/2. Also, the column names on the grid should change dynamically based on the itemtypes being displayed in the grid. it is safe to assume that only items belonging to one itemtype will be displayed within the same grid. I have been able to implement such a user interface quite easily using pure "Java" based frameworks like ZK, but I can't figure out how to implement it in Tapestry. I think there is way to do this in T5, and people have referred to the "FormInjector" component, but I looked at some examples and cannot understand how it relates to my problem. Some others have hinted at the "Delegate" component, but i can't understand that either. Then some others have hinted at the "Block" component, but i have not been able to understand that either:-( Can anybody help me here?? I assume this must be a common requirement in many systems!! -- View this message in context: http://www.nabble.com/t5%3A-Dynamic-Forms---Grids-tp25163809p25163809.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org