#Introduction

In this lab you'll add a _business_ property to the businesses tab panel.

#Steps

??Plan your work

The main view needs to detect when a business is selected, and pass that
value to the detail panel. 

The map and table could detect business selection and update the detail 
panel directly. But that would break principles of encapsulation and 
coupling. A given view should have no knowledge of other views that 
may be in the app, and only communicates to the app via property 
binding and event handling.

The rule of thumb is that the container that creates views is responsible
for coordinating how information is passed between the views.

Following those guidelines, in Yelp we need to do a few things:

- Define a `business_` property on the tab panel class, along with an event
- Have the main view detect the business change event and pass the record to the detail panel

??Add `business` as a tab panel property

Add a `business_:null` config property to `Yelp.view.businesses.Tabs`.

Add an `afterSetBusiness(business)` method that logs the business.

You can test this by saving, refreshing, then on the console update the property.

    Neo.findFirst({ntype: 'yelp-businesses-tabs'}).business = {name: 'Some business'}

You should see the data being logged.


??Detect changes to the map selection

Set up an event handler to detect the map's _markerChange_ event.

    listeners: {
        markerClick: data => data.data.component
            .up({ntype: 'yelp-businesses-tabs'}).business = data.data.record
    }

Save and refresh, then verify that as you click on map markers the 
corresponding record is being logged. 

??Fire a _businessChange_ event

Update the `afterSetBusiness` method to fire the event. Note the 
addition of the first statement that ignores empty values. We don't
need the `console.log` statement any more.

    afterSetBusiness (business){
        if (!business) return;
        this.fire('businessChange', {component: this, business});
    }


??Detect the event in the main view

Add an `onBusinessChange` event handler in the main view. It should log the business.

Then in the main view, configure the _businessChange_ listener to use that handler.

Save and refresh. As you choose map markers you should see the log emanating from
the main view controller. 