         @_skipUpdate = true
         @value newValue
   
-  @method '_valueChanged', (oldValue, newValue) ->
-    if @_skipUpdate
-      @_skipUpdate = false
-    else if @_loaded
-      @_selectElement[0].selectedIndex = if @_valueIndex[newValue]? then @_valueIndex[newValue] else 0
+  @method 'setValue', (newValue) ->
+    if @isValueValid(newValue)
+      @_value = newValue
+      if @_skipUpdate
+        @_skipUpdate = false
+      else if @_loaded
+        @_selectElement[0].selectedIndex = if @_valueIndex[newValue]? then @_valueIndex[newValue] else 0
   
   @method '_valuesChanged', (oldValues, newValues) ->
-    @value null unless @_values[@_value]
+    @value null unless @isValueValid(@value)
     @renderOptions() if @_loaded
   
   @method '_idChanged', (oldValue, newValue) ->

      html.push '<option value=""'
      html.push ' selected="selected"' if @_value is null
      html.push '></option>'
    for value, label of @_values
      if @_values.hasOwnProperty value
        html.push '<option value="', value, '"'
        html.push ' selected="selected"' if @_value == value
        html.push '>', label, '</option>'
        @_valueIndex[value] = index++
    @_selectElement.html html.join('')
  
  @method 'selectChanged', (e) ->

ST.class 'EnumFieldView', 'View', ->
  @initializer 'withValuesNull', (values, _null) ->
    @init()
    @_value = if _null then null else values[0][1]
    @_null = _null
    @_values = values
    @_valueIndex = {}
