The diagram below shows how Pentaho Xul MVC would operate in an example UI widget project Foo. Starting from the left we see that the xul file foo.xul is represented in your application as a XulDom. The XulDom is what we consider to be the View part of the our MVC pattern. implementation The Xul framework by way of the XulDom is responsible for instantiating and laying out UI components, however, as we mentioned earlier view logic is not handled by the XulDom. The responsiblity for handling view logic rests on the Controller and can be thought of as being component-state events or non-component-state events.
Data Binding and Component-state Events
It is the responsiblity of your Controller implementation to setup bindings between your XUL components and your data model (a POJO/Java Bean). What do we mean by "binding"? Binding is a way to associate bean properties so that when one changes, the other is kept in sync. Binding can be unidirectional or bidirectional, but we won't get into that here. We will assume that a binding is always bidirectional meaning when either side of the binding changes, the other will reflect the change.
In the diagram you will see that the XulDom fires "events" to the FooController. Events in this contex
- represented as a Java Bean (with property change support)
- contains view logic such as enablement and visibility, i.e. the state of UI components
- applies form validation