     for model in this.collection.models
       if @filterFunc model, @filters
         count += 1
+    @cachedCount = count
     return count
+
+  showAlerts: () ->
+    state = @listMeta.get("state", "listing")
+    if state == "listing" and @cachedCount == 0
+      state = "empty"
+
+    states = {
+      "loading": @loadingSelector,
+      "error": @errorSelector,
+      "empty": @emptySelector
+    }
+    activated = false
+    for priority, selector of states
+      # show the alert if it is the current state
+      # unless a higher order alert was already activated
+      if not activated and state == priority
+        @showAlert(selector)
+        activated = true
+      else
+        @hideAlert(selector)
+
+    if @cachedCount > 0
+      @showAlert(@existsSelector)
+    else
+      @hideAlert(@existsSelector)
+
+  showAlert: (selector) ->
+    status = @listMeta.get(selector)
+    if not status or status is undefined
+      # console.log("[alert on] #{selector}")
+      @listMeta.set(selector, true)
+      @$el.find(selector).removeClass @emptyToggleClass
+
+  hideAlert: (selector) ->
+    status = @listMeta.get(selector)
+    if status or status is undefined
+      # console.log("[alert off] #{selector}")
+      @listMeta.set(selector, false)
+      @$el.find(selector).addClass @emptyToggleClass
 
 module.exports =
   mixins:


  added: (model, container) ->
    if @filterFunc model, @filters
      skipShowEmpty = container == undefined
      if not container
        container = @getListElement().get(0)
      view = @getItemView model

          container.insertBefore(rendered, el)
        else
          container.appendChild(rendered)
      @cachedCount += 1
      return view
    return null

