       @renderAllItems()
 
 
+    # Main render method (should be called only once)
+
+    render: ->
+      super
+      #console.debug 'CollectionView#render', @, @collection
+
+      # Set the $list property
+      @$list = if @listSelector then @$(@listSelector) else @$el
+
+      @initFallback()
+
+
+    #
+    # Fallback message when the collection is empty
+    #
+
+    # Initialize the fallback
+
+    initFallback: ->
+      return unless @fallbackSelector
+
+      # Set the $fallback property
+      @$fallback = @$(@fallbackSelector)
+
+      # The collection has to be a deferred in order that
+      # the fallback can be shown properly
+      f = 'function'
+      isDeferred = typeof @collection.done is f and typeof @collection.state is f
+      return unless isDeferred
+
+      # Listen for visible items changes
+      @bind 'visibilityChange', @showHideFallback
+
+      # Register a done handler on the collection
+      # TODO: How to dispose this reference?
+      @collection.done @showHideFallback
+
+    # Show or hide the fallback when the visible items change
+
+    showHideFallback: =>
+      console.debug 'CollectionView#showHideFallback', @, @visibleItems, @collection
+      # Show fallback message if no item is visible and
+      # the collection Deferred has been resolved
+      empty = @visibleItems.length is 0 and @collection.state() is 'resolved'
+      @$fallback.css 'display', if empty then 'block' else 'none'
+
+
     # Render and insert all items
+    # Accepts the options `shuffle` (Boolean) and `limit` (Number)
 
     renderAllItems: (options = {}) =>
 


      visibilityChanged

    # Remove the whole list from DOM
    dispose: =>
      #console.debug 'CollectionView#dispose', @, 'disposed?', @disposed 
      return if @disposed

      # Dispose all item views
      view.dispose() for own cid, view of @viewsByCid

      # Remove jQuery object, item view cache and reference to collection
      properties = '$listElement viewsByCid visibleItems'.split(' ')
      delete @[prop] for prop in properties

      # Self-disposal

      # Render template once
      @render() if options.render

      # Render all items initially
      @renderAllItems() if options.renderItems


    # Binding of collection listeners

    addCollectionListeners: ->
      @modelBind 'loadStart', @showLoadingIndicator
      @modelBind 'load',      @hideLoadingIndicator
      @modelBind 'add',       @itemAdded
