I have a model that can be described as follows:
http://aoeu.se/so/animal-dog-cat.png
(Extremely simplified. My actual classes have about ten-twenty more fields each.)
I have the persistence all worked out and I'm now trying to create a form in which users should be able to create objects of these classes (dogs and cats).
I would like it to look roughly as follows:
http://aoeu.se/so/new-animal-form.png
(I already have the HTML and the enabling / disabling of input fields implemented.)
To my question: How do I best implement the form processing? I don't see how I can directly use PropertyModels and such since the type of model object depends on the first Dog/Cat choice.
If Wicket guarantees that the order in which the fields are processed is the same as the order in which they appear in the web page, then I guess I could create the model object once the animal type input is processed (since it's the first form component), and let the remaining fields use a PropertyModel.