                 isActive: isActive,
                 edited: @state.edited,
                 settings: @props.settings,
+                selected: @state.selected[id]?,
                 onSelect: (val) =>
+                    selected = _.clone @state.selected
                     if val
-                        @_selected[id] = val
+                        selected[id] = val
                     else
-                        delete @_selected[id]
-                    if Object.keys(@_selected).length > 0
-                        @setState edited: true
+                        delete selected[id]
+                    if Object.keys(selected).length > 0
+                        @setState edited: true, selected: selected
                     else
-                        @setState edited: false
+                        @setState allSelected: false, edited: false, selected: {}
 
         .toJS()
         nbMessages = parseInt @props.counterMessage, 10

            loading: false
            filterFlag: false
            filterUnsead: false
        }

    componentWillReceiveProps: (props) ->
        @setState loading: false
        if props.mailboxID isnt @props.mailboxID
            @setState edited: false
            @_selected = {}

    render: ->
        compact = @props.settings.get('listStyle') is 'compact'

        LayoutActionCreator.refreshMessages()

    toggleEdited: ->
        if @state.edited
            @setState allSelected: false, edited: false, selected: {}
        else
            @setState edited: true

    toggleAll: ->
        if @state.allSelected
            @setState allSelected: false, edited: false, selected: {}
        else
            selected = {}
            @props.messages.map (message, key) ->
                selected[key] = true
            .toJS()
            @setState allSelected: true, edited: true, selected: selected

    onDelete: ->
        selected = Object.keys @state.selected
        if selected.length is 0
            alertError t 'list mass no message'
        else
