context = window
rest = window.JK.Rest()
logger = context.JK.logger

@SubjectCheckBoxList = React.createClass({

  mixins: [Reflux.listenTo(@SubjectStore,"onSubjectsChanged")]

  propTypes: {
    onItemChanged: React.PropTypes.func.isRequired
  }

  getDefaultProps: () ->
    selectedSubjects: []

  getInitialState:() ->
    {subjects: []}

  onSubjectsChanged: (subjects) ->
    @setState({subjects: subjects})

  render: () ->
    `<div className="SubjectCheckBoxList react-component">
        <CheckBoxList objectName='subjects' onItemChanged={this.props.onItemChanged} sourceObjects={this.state.subjects} selectedObjects={this.props.selectedSubjects}/>
    </div>`
})