The JSF specification states that JSF components (or more specifically their classes) can implement one or more behavioural (Java) interfaces, or in other words standard behaviour functionality. There are effectively only 5 types within the JSF spec. Knowing this you can surmise the functionality of each component; if something works for 1 component with a specific behavioural interface, it should work for the rest:
- StateHolder – describes a component that has state and must be saved between requests, or in other words, multiple request-responses of a single user session. UIComponent implements StateHolder, thus by default all JSF components implement this behaviour.
- ValueHolder – a component that can access data from a data model tier and also maintain a local value. Both UIInput and UIOutput implement this interface.
- ActionSource – allows the component to fire an action event via a registered ActionListener calling a backing bean method, upon a submit to the mid tier. This is used by submit UICommand buttons and similar controls (such as the ADF Faces menu components).
- EditableValueHolder – an extension of ValueHolder allowing validation and raising value-change events via a ValueChangeListener.
- NamingContainer – requires each component and child component to have a unique ID.
Oracle has taken the behavioural interfaces further, and implemented 2 additional behavioural interfaces:
- CollectionComponent - any component such as UIXTable that pages across records and is useful when screen real-estate is limited or you want to stop the user querying all records in 1 hit. It starts at a particular index in a row set, and includes the number of records to show on each page.
- DialogSource - any component that opens a ADF Faces dialog, and in turn needs to be notified when the dialog closes. An extension of ActionSource and notably used on UIXCommand controls. Includes listeners for passing values to and from the dialog.
No comments:
Post a Comment