how to work with dynamic forms and tables


i’m new to vaadin, so sorry if this is obvious, but my reading about the various vaadin containers hasn’t helped me find a solution to this problem.

i frequently make systems that require dynamic forms to be made that depend on dynamic values in the system, these may be user defined or administrator defined. a random example is…

user rights

  • an administrator of my system may create a new user group that has specific (and possibly new) privileges and/or relationships. this user group must now be presented with the relevant new form in their user profile. their form may include new relationships to existing data, e.g. this new user group may be linked to particular products, and/or include new relationships to new data e.g. this new user group may now have an image, or multiple files associated with it.

the aim is to have a single form class and an associated single table class that can CRUD all data by binding to the correct objects. so in pseudo code i would have something like…

//show table data inc. edit
ModuleConfig moduleConfig = getModuleConfig(thisModuleId);
JazzyTable jazzyTable = new jazzyTable(moduleConfig);

//show form
ModuleConfig moduleConfig = getModuleConfig(thisModuleId);
JazzyForm jazzyForm = new jazzyForm(moduleConfig);

the problem at this point is not the generation of the form, or the underlying database tables to store the data, but how to make vaadin to update this data which may include relationships with multiple tables. i have considered creating on the fly classes and updating the hibernate xml on the fly to hook into the jpa container, but this seems really overboard for a low load administration system.

so i was hoping someone could provide a good approach to this problem!