     @moduleName.getModel().onDidChange => @checkInput()
     # @mainEntry.getModel().onDidChange => @checkInput()
     @selectProject.on 'change',(e) => @onSelectChange(e)
+    @selectAppPath.on 'change',(e) => @toggleRow(e)
+    @selectModulePath.on 'change',(e) => @toggleRow(e)
     @moduleName.setText ''
     @moduleId.setText ''
     # @mainEntry.setText desc.mainEntryFileName

      @h2 desc.createModuleTitle, class: 'box-subtitle'
      @div class: 'box-form', =>
        @div class: 'form-row clearfix', =>
          @label desc.moduleInApp, class: 'row-title pull-left'
          @div class: 'row-content pull-left', =>
            @select class: 'form-control', outlet: 'selectProject'
        @div class: 'form-row clearfix', =>
          @label desc.modulePath, class: 'row-title pull-left'
          @div class: 'row-content pull-left', =>
            @div class: 'textEditStyle', outlet: 'modulePath'
            @span class: 'inline-block status-added icon icon-file-directory openFolder', click: 'openFolder'
        @div class: 'form-row clearfix', =>
          @label desc.moduleId, class: 'row-title pull-left'
          @div class: 'row-content pull-left', =>

    @parentView.disableNext()
    @parentView.hidePrevBtn()

    @projects = @findProject()
    projectNum = @projects.length

    if projectNum isnt 0
      @selectProject.find('.sopt').remove()
      @setSelectItem path for path in @projects
      @selectAppPath[0].checked = true
    else
      @setSelectItem '','sopt'
      @selectModulePath[0].checked = true
    @toggleRow()
    @setSelectItem 'other','other',"#{desc.other}--#{desc.openFromFolder}"
    @checkPath()

  # destroy: ->
  #   @element.remove()

  toggleRow: ->
    console.log 'toggleRow'
    selectRow = @selectProject.parents('.form-row')
    inputRow = @modulePath.parents('.form-row')
    if @selectModulePath[0].checked
      selectRow.addClass disabled
      inputRow.removeClass disabled
      @openBtn.removeClass disabled
      @selectProject.attr(disabled,disabled)
    else
      inputRow.addClass disabled
      @openBtn.addClass disabled
      selectRow.removeClass disabled
      @selectProject.removeAttr(disabled)
    @checkPath()

  setSelectItem:(path,className,text,insertBefore,isSelected) ->
    if className?
      text?=""
      optionStr = "<option value='#{path}' class='#{className}'>#{text}</option>"
    else
      filePath = pathM.join path,desc.ProjectConfigFileName
      obj = Util.readJsonSync filePath
      projectName = if obj? then obj.name else pathM.basename path
      if isSelected? and isSelected is true
        isSelected = ' selected'
      else
        isSelected = ''
      optionStr = "<option value='#{path}' class='sopt'#{isSelected}>#{projectName}  -  #{path}</option>"
    if insertBefore is true
      @selectProject.find('.other').before optionStr
    else
      @selectProject.append optionStr

  getElement: ->
    @element

  getPath: ->
    if @selectAppPath[0].checked
      pathM.join @selectProject.val().trim(),'modules'
    else
      @modulePath.html().trim()

  serialize: ->

