2 Replies Latest reply on Dec 27, 2008 10:05 AM by MacGyverMan

    Trouble with a Drop-in rederer-editor

    MacGyverMan
      Hi,

      I've got a data grid that's supposed to show hierarchical data in one row. If the user clicks one of the leaf nodes, the node is editable, there are 2 options:

      * Add Item node
      * Existing node

      When clicking the add item node, I want a textinput to replace the label, once the edit is done, the datagrid must add a new item to the dataprovider and preserve the old Add Item node...this is similar to power point's bulletted lists, where an "add ..." appears in grey.

      Here is the code I have for the mixed renderer-editor.

      Here are the problems I am facing:

      1 - The focus_out event does not always trigger. This causes my item to remain in edit mode.
      2 - Dispatching the AdvancedDataGridEvent.ITEM_EDIT_END event causes the program to crash with the following message:




      TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.controls::AdvancedDataGridBaseEx/itemEditorItemEditEndHandler()[C:\work\flex\dmv_autom ation\projects\datavisualisation\src\mx\controls\AdvancedDataGridBaseEx.as:6471] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\co re\UIComponent.as:9156] at renderers::ADGEntryBulletEditor/setNewData()[C:\wwwroot\Flex\JOA_Homework\renderers\ADGEn tryBulletEditor.mxml:112] at renderers::ADGEntryBulletEditor/endEdit()[C:\wwwroot\Flex\JOA_Homework\renderers\ADGEntry BulletEditor.mxml:95]

      This appears to be due to the data property not being set (the debugger lists a series of variables, the data and listData variables are null)...but I don't know how to set these guys.

      3 - How can I add to the source collection easily?


      Thanks for any help