Hi! I’m reaching out to the Vaadin 7 gurus as to the best, all around, approach of separation into MVP/MVC type pattern for a project I am working on.
Simple Background on Project:
– Vaadin 7 based
– Using JPA (and specifically JPA Container) w/ Hibernate (not that it makes a difference for the question).
Here is the issue I am about to tackle, and just don’t want to create a LOT of work for myself.
As part of the application, the main Entity the application is based around needs to be displayed. I already have a nice table/search thing going, so that’s fine…
However, this Entity (let’s call it Detainee) has a very complex ERD associated with it, involving not only lookup table values for various fields (sex, gender, etc) but a TON of relationships – both One2One and One2Many, etc.
I need to show all the information about a single detainee – the existing system (Desktop App) does this by having a “window” that has 15 different tabs – each tab showing a major part of the overall record set. There is a tab with all the basic information, and then basically a tab for each “relationship” off the main Entity. Each tab itself contains a LOT of fields – the main one has 70 or so, the others about the same or less. And of course, the client wants to show the fields in a “pretty” layout, with formatting of appropriate fields, etc.
My first proof of concept (for the main data tab) is that I passed in from the “List Table” to the main show form, the POJO of the main Entity – and then converted that to a BeanItem and then used a FieldGroup and finally a grid layout (set to an arbitrary 7 columns) and looped through the propertyid’s and did an “addComponent” with a “buildAndBind”.
Well, that dumped out a bunch of information but in no way did it look “good” and I had the following problems:
– Some propertyIds should just not be shown (business logic only)
– Some needed formatting (2 types of different date formatting)
– Some needed a bigger size “text” box to display the info
– Some needed to be renamed
– The layout order was alphabetical, and certainly not in the order the customer wanted.
Now, if this were just a few fields I could see maybe “hand coding” the layout – but this is 15 tabs, each with 50+ fields!
Is there a good pattern for such things? How do people layout “real” forms (i.e. from a real-world complex model) that can handle this w/o hand coding each property?
Also, is passing the POJO a good idea? I’m thinking since I have a JPAContainer item that’s selected, I should just pass an Item thing around and feed that into the FieldGroup?
Oh – and of course, I’d like this to be I18N so the Label/Caption names are looked up.
More desires: If the user stretches the screen, the fields and spaces between nicely expand . If they shrink the window the reverse, until we need scrollbars …
Phew!
I’ve looked at what I think are possible Add-ons but nothing exactly pops out – maybe because I haven’t chosen a “pattern” yet.
Any thoughts, help, etc. would be appreciated!
Cheers!