O'Reilly logo

Ext GWT 2.0 Beginner's Guide by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - responding to selections

  1. In the AppEvents class, define the three new events.
    public static final EventType FeedSelected = new EventType();
    public static final EventType ItemSelected = new EventType();
    
  2. In the onRender method of the FeedList class, create a SelectionChange Listener so that it forwards a FeedSelected AppEvent with the selected Feed attached using the Dispatcher.
    feedList.addSelectionChangedListener(new SelectionChangedListener<BeanModel>() {
    @Override
    public void selectionChanged(SelectionChangedEvent<BeanModel> se) {
    Feed feed = se.getSelectedItem().getBean();
    if (feed != null) {
    Dispatcher.forwardEvent(AppEvents.FeedSelected, feed);
    }
    }
    });
    
  3. Register the FeedSelected EventType in the FeedController.
    public FeedController() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required