title: Difference between serializeData and onRender in Marionette.CompositeView
body: <p>I am using <a href="https://github.com/derickbailey/backbone.marionette/blob/master/docs/marionette.compositeview.md" rel="nofollow"><code>Marionette.CompositeView</code></a> and I would like to understand the difference between serializeData and onRender
  based on these two exemple (1) and (2).      </p>
  
  <p>According the documentation serializeData is called in render before applying the template, and onRender is called in render after applying the template.       </p>
  
  <p>My questions are:<br>
  1) why the example (1) works and the (2) does not?<br>
  2) If I reset the collection, will the <code>Marionette.CompositeView</code> be re-rendered?          </p>
  
  <p>Please see the comments in the code for more details. </p>
  
  <hr>
  
  <p>(1)</p>
  
  <pre><code>return Marionette.CompositeView.extend({
  
          initialize: function () {
              this.collection = new MyCollection();
              this.collection.fetch();
          },
  
          onRender: function () {
              this.collection.length &gt; 0 ? this.$el.show() : this.$el.hide();
             // it returns this.collection.length &gt; 0 
             // differently from serializeData.
          }
  });
  </code></pre>
  
  <hr>
  
  <p>(2)</p>
  
  <pre><code>return Marionette.CompositeView.extend({
  
          initialize: function () {
              this.collection = new MyCollection();
              this.collection.fetch();
          },
  
          serializeData: function () {
              this.collection.length &gt; 0 ? this.$el.show() : this.$el.hide(); 
             // it returns this.collection.length = 0 
             // even if this.collection.length &gt; 0. Why?
          }
  });
  </code></pre>