I'm trying to create an input form for a part of my application. I have three classes:
Now what I want on my input form is input boxes for the various shared elements. I'd then like radio buttons where you can select if the field is a DataField or a TypeField. That would then show the appropriate additional fields for DataField or TypeField.
Now that's easy enough to do. But where I'm confused is what to bind them too. Previously I'd have using something like:
But I can't see this working this time as what would EntityHome extend? Whatever it extends, my instance would not have all the fields it requires.
So far I've considered creating a wrapper that contains variables for all fields in Field, DataField and TypeField. Then on persisting, I can calculate the right object type to persist as. Is this the right way to go or am I missing something? My JSF and Seam fundamentals do have a few gaps in them so sorry if this is something quite basic.