As we've seen already, there's a Component
to render an entire entity. In fact, it's possible to provide more than
one Component
to do this. We could also view the
entity in a tabbed view:
When there is more than one Component
capable of rendering the object, Wicket Objects
allows the view to be selected:
This works for collections too; using the selector we can view a
collection of Employee
s in a variety of
ways:
Selecting the icons
view shows the collection
of Employee
s as icons:
So far all the screenshots we've seen have been generated from a
basic domain application, with no custom GUI coding (see Appendix A, Example Application). But Wicket Objects is
also extensible. So, we can write custom views/components, provide a
corresponding ComponentFactory
and then plug them
into Wicket Objects' registry of
ComponentFactory
s. For example, if we make
Employee
implement a view-specific
Locatable
interface, then we can render them on a
google-maps mashup:
The selector, by the way, is actually implemented as yet another
view/component, capable of rendering the entity or collection. It
queries the ComponentFactory
registry to
determine how many other ComponentFactory
s there
are capable of rendering the entity or collection; if more than one then
it provides a drop-down and then delegates to the other
Component
s to do the work.