title: How to fetch data from model when another model is selected?
body: <p>I have created one model for Event Categories, and another model for Events. When user will select any particular event category, I want to display all the events under that category.</p>
  
  <p>The following are the relations I've given to their models.
  EventCategory.php Model:</p>
  
  <pre><code>return array(
      'event' =&gt; array(self::HAS_MANY, 'Event', 'event_category_id'),
  );
  </code></pre>
  
  <p>Event.php Model:</p>
  
  <pre><code>return array(
       'category' =&gt; array(self::BELONGS_TO, 'EventCategory', 'event_category_id'),
  );
  </code></pre>
  
  <p>When I try to return events in event category view, <strong>NOT SET</strong> is returned.</p>
  
  <pre><code>&lt;?php $this-&gt;widget('zii.widgets.CDetailView', array(
  'data'=&gt;$model,
  'attributes'=&gt;array(
      'evntcatm_id',
      'evntcatm_name',
      'evntcatm_desc',
      'evntcatm_img',
      'event.evntm_evntcatm_id',
      'event.evntm_name',
  ),
  )); ?&gt;
  </code></pre>
  
  <p>Where I am going wrong?</p>