Model View Presenter for a view with two panels
This recipe is the continuation of the previous Login form with Model View Presenter recipe. In this recipe, we will create a complex view, which will consist of two panels. The first panel will be used for adding new items and the second for showing the list of items.
The application will be about adding tags to the database and showing the list of all the tags from a database. The layout of the user interface is as follows:
Getting ready
Before we start, we create a simplified class diagram of the application we are going to develop. Start reading the class diagram from the MyVaadinUI
class. MyVaadinUI
creates the tag view, tag presenter, and the tag service. The implementation of the TagView
interface, the TagViewImpl
class, contains two layouts, the first one for creating new tags and the second to display the list of the tags. TagService
provides and saves the instances of the Tag
class. TagPresenter
binds view and service layer together...