fx:DataForm:DataFormItem Date Issue

2009-07-19
2013-04-29
  • Curtis Fisher
    Curtis Fisher
    2009-07-19

    I hope this isn't one of those errors you're going to scratch your head and think "What the heck is he doing now?". 

    Here is the scenario...

    AIR Application testing locally with a Sybase DB and Glassfish App Server.

    I am using the Generated templates, the error only happens on Date fields.  I have not modified the template in any way, since i start out by testing it fully before integrating it into my app.

    Here are two of them from the GridFormTest

    <fx:DataFormItem dataField="StartDT" label="Startdt:" formatString="shortDate"/>
    <fx:DataFormItem dataField="EndDT" label="Enddt:" formatString="shortDate"/>

    This is the state of the DateField when the error that says I'm trying to write to a read only property...

    dataSourceObject    com.farata.controls.DateField (@cdca0a1)   
        [inherited]   
        formatString    "MM/DD/YYYY"   
        readOnly    false

    When the error occurs the log shows the following...

    ReferenceError: Error #1074: Illegal write to read-only property value on com.farata.controls.DateField.
        at com.farata.controls.dataFormClasses::DataFormItemEditor/set data()[I:\ProContentWorkSpace\com.farata.components\src\com\farata\controls\dataFormClasses\DataFormItemEditor.as:73]
        at com.farata.controls.dataFormClasses::DataFormItem/set data()[I:\ProContentWorkSpace\com.farata.components\src\com\farata\controls\dataFormClasses\DataFormItem.as:113]
        at com.farata.controls::DataForm/distributeData()[I:\ProContentWorkSpace\com.farata.components\src\com\farata\controls\DataForm.as:176]
        at com.farata.controls::DataForm/creationCompleteHandler()[I:\ProContentWorkSpace\com.farata.components\src\com\farata\controls\DataForm.as:186]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
        at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
        at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628]
        at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]

    the form is now showing and this is what happens when i select the date from the form...
    ReferenceError: Error #1069: Property selectedDate not found on com.farata.controls.dataGridClasses.InPlaceEditor and there is no default value.
        at mx.controls::DataGrid/itemEditorItemEditEndHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:4827]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
        at mx.controls::DataGrid/endEdit()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:4041]
        at mx.controls::DataGrid/editorMouseDownHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:4612]

    I figured out a workaround by using the fx:DataGridColumn for the Dates and the form for text data.  The problem only occurs with the     fx:DataForm I have been using the "Rough Cuts" version of your new book, Enterprise Development with Flex, 1st Edition and it's has been very helpful in my evaluation of the Farata Component Framework.

    Dear Farata Team, do you have any ideas about this error?  And thank you for sharing your hard work for the rest of us to benefit from.

    Curtis