I'm writing a web app that's used to manage a lot of tables in a database. So 
we'll have some simple tables, like a table for contact information, a table 
for department listings, a table for this, for that.

They all have an "edit" page, which at the moment, I usually copy/paste one of 
the other page/html/BasePage, and modify them for the different fields. So I'll 
change "firstName" and "lastName" on two textboxes to "departmentTitle" and 
"departmentBranch", change the "selectedObject" property's type to whatever 
that page is editing.

Basically, a lot of simple forms with a textbox for every column (except the 
primary key).

So my question, is there some neat way to do this dynamically with reflection? 

I could look up every property of the object, then auto-generate this edit 
page? The "save" button would just call a hibernate saveOrUpdate() method which 
can take any object. I've done something like this with my confirmation page 
when someone wants to delete something. I pass a "selectedObject" and 
"objectDAO" to the page, so the page says "Are you sure you want to delete?", 
if they hit yes, it just calls the DAO's delete method. So if they're browsing 
a department, when they select and hit Delete, the delete handler sets the 
objectDAO to the DepartmentDAO object. I thought that was really cool how I can 
use 1 page everywhere, and if I could find a way to get some crazy editing page 
(obviously I'd need some properties to pass to it, like which fields to hide), 
I'd eliminate a TON of pages!!!

Thanks!
Greg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to