Tags:
create new tag
, view all tags
-- PedroRio - 30 Mar 2011

XEO Web Components - Viewer Events

Viewer Events is a mechanism that allows to interact at the bean level during the life-cycle of a server request. The request life-cyle is depicted in figure 1. There are several points in the request life-cycle in which you can interact, the list is in the following table:

Property DescriptionSorted ascending
afterUpdateModelPhase Occurs after applying component values to beans/XEO Model instances
afterApplyRequestValuesPhase Occurs after applying request parameters to the component
afterRenderPhase Occurs after rendering the current view
beforeUpdateModelPhase Occurs before applying component values to beans/XEO Model instances
beforeApplyRequestValuesPhase Occurs before applying request parameters to the components
beforeRenderPhase Occurs before rendering the current view
onCreateViewPhase Occurs the first time a viewer is displayed
onRestoreViewPhase Occurs whenever a request is made to the viewer and it has already been initialized

All these properties (events) accept an EL Expression to a method with the following signature:

public void myEventMethod( PhaseEvent e);

Let's see an example:

Viewer Declaration:

<xvw:viewer beanClass='MyBean'
    beanId='viewBean'
        afterUpdateModelPhase= '#{viewBean.afterUpdateModel}'
        afterRenderPhase= '#{viewBean.phaseEvent}'
>

Bean:

public class MyBean {
    public void afterUpdateModel( PhaseEvent e ) {
         System.out.println( "After update Model!!" );
    }
    public void afterRender( PhaseEvent e ) {
         System.out.println( "Before update Model!!" );
    }

}

The life-cycle of a server request is depicted in figure 1, bellow:

EsquemaUI2.0.png

Figure 1 - The life-cycle of a server request

_

Edit | Attach | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 2011-04-04 - NicolauGrosskopf
 

No permission to view TWiki.WebTopBar

This site is powered by the TWiki collaboration platform Powered by Perl

No permission to view TWiki.WebBottomBar