Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

8. Connecting views with Mediators > Working with complex composite views

Working with complex composite views

You always have access to the eventMap property itself, so if you wanted to listen to two child buttons on your view, that were exposed through getters, you can use the event map to manage this:

Example 8-4. MosiacTool: TileSupplyDetailViewMediator.as maps listeners to two Button sub-components of the mediated view

override public function onRegister():void
{
    eventMap.mapListener(view.deleteButton, MouseEvent.CLICK, 
                                       dispatchDeletionRequest, MouseEvent);
    eventMap.mapListener(view.radioButton, MouseEvent.CLICK, 
                                    dispatchSupplySelected, MouseEvent);
    addViewListener(ColorChangeEvent.CHANGED, 
                                    dispatchColorChange, ColorChangeEvent);
    addContextListener(TileSupplyEvent.QUANTITY_CHANGED, 
                                    updateCount, TileSupplyEvent);
}

  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial