1 Reply Latest reply on Dec 7, 2006 7:27 PM by ntsiii

    DateField coercion failed

    javamonjoe Level 1
      I'm using a datefield as an itemEditor in a DataGrid. A String var is bound to the cell. When editing the grid this error normally occurs:

      TypeError: Error #1034: Type Coercion failed: cannot convert "" to Date.
      at mx.controls::DateField/set data()
      at mx.controls::DataGrid/::itemEditorItemEditBeginHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/dispatchEvent()
      at mx.controls::DataGrid/::commitEditedItemPosition()
      at mx.controls::DataGrid/mx.controls:DataGrid::updateDisplayList()
      at mx.core::UIComponent/validateDisplayList()
      at mx.managers::LayoutManager/::validateDisplayList()
      at mx.managers::LayoutManager/::doPhasedInstantiation()
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.core::UIComponent/::callLaterDispatcher2()
      at mx.core::UIComponent/::callLaterDispatcher()

      My users really don't like my code to crash like this. I'm not using any "Date" related fields. The value listed in the error, an empty string, can also be a validly formatted date (ie "12/3/06"). Is the DateField really that unstable or am I doing something wrong?