Dropdownchoice not updating model
In Wicket a model is any implementation of the interface The IModel interface defines just the methods needed to get and set a data object (get Object() and set Object()), decoupling components from concrete details about the persistence strategy adopted for data.
In addition, the level of indirection introduced by models allows access data object only when it is really needed (for example during the rendering phase) and not earlier when it may not be ready to be used.
Wicket models are designed to solve these kinds of problems.
Even if sometimes writing a custom model could be a good choice to solve a specific problem, Wicket already provides a set of IModel implementations which should fit most of our needs.
In order to make this task as easy as possible, Wicket offers two special model classes: However this solution has a huge drawback: the text displayed by the label will be static and if we change the value of the field, the label won't update its content.
As a consequence, to make the most of Compound Property Model we must assign it to one of the containers of a given component, rather than directly to the component itself.
In contrast, models like Property Model and Compound Property Model are called dynamic models.
Method on Submit is called whenever a form has been submitted and it can be overridden to perform custom actions.
The topic of security will be discussed later in chapter 20.
The following form is for example purposes only and is not suited for a real application.
The Model class comes with a bunch of factory methods that makes it easier to build new model instances.