Feb 28th, 2013, 12:55 PM
Entity create form - selecting it's "parents" many-to-one related entities
I'm building an app in wich I have a chain of many-to-one related entities, each one representing a group of the next, down to the "bottom" (not group) one. For every entity in this chain, the app offers CRUD functionality. My problem is: when creating an entity, in it's creation form the user must be able to select the groups it will belong to up to the top one.
A good analogy would be the Country-State-City-Street relationship. When creating a street, I cannot be limited to choose from it's direct group, city, because the city I'm choosing may be in the wrong country. So I must be able to first select the country, then the state (from that country), and then the city (from that state).
In fact, the same applies to the city creation form, because I must be able to select the state and country it will belong to.
So we could say that: for every entity, it's creation form must allow the user to select the entire chain of groups it will belong to.
How do I do that in a Spring Roo app?
I'm considering using the web flow, being each state one "group selection" phase. In State1, the user selects the country, and that selection moves the flow to State2, and so on, all flow states using the same view. But I have no idea how to do that, and whether that is the best option for solving my problem.
Any help would be much appreciated.
Tags for this Thread