     @switchStateChanged() if wCallback
 
   _setOn:(wCallback = yes)->
-    return if @getValue()
+    return if @getValue() and wCallback
     @inputDefaultValue = on
     @getDomElement().find("input").eq(0).attr "checked",yes
     @$('a.off').removeClass('active')

class KDRySwitch extends KDInputView
  constructor:(options)->
    options = $.extend
      type : "switch"       # mandatory
      size : "small"        # a String "small" or "big"
    ,options  
    super options
    @setClass options.size
    @setPartial "<input class='checkbox hidden no-kdinput' type='checkbox' name='#{@getName()}'/>"

  setDomElement:(cssClass)->
    @domElement = $ "<div class='kdinput kdinputswitch-ry off #{cssClass}'><a href='#' class='on' title='turn on'>ON</a><a href='#' class='off' title='turn off'>OFF</a></div>"

  setDefaultValue:(value) ->
    switch value

    , 0

  _setOff:(wCallback = yes)->
    return if not @getValue() and wCallback
    @inputDefaultValue = off
    @getDomElement().find("input").eq(0).attr "checked",no
    @$('a.on').removeClass('active')
