Hi

Can you please point to any code sample?

Thanks
ilikeflex

--- In [email protected], Alex Harui <aha...@...> wrote:
>
> Standard practice is to call preventDefault on ITEM_EDIT_END and update the 
> data yourself.
> 
> 
> On 5/17/10 1:31 PM, "ilikeflex" <ilikef...@...> wrote:
> 
> 
> 
> 
> 
> 
> Hi
> 
> I am using the item editors and went through the following article
> http://www.adobe.com/devnet/flex/articles/itemeditors_pt2.html.
> 
> I am using nested properties in the dataprovider. I use label function to 
> diaplay the data in grid. But when i edit the datagrid usinf the itemeditors 
> i get the error
> ----------------------------------------------------------
> ReferenceError: Error #1069: Property compatableInd.id not found on 
> com.vzw.mpi.rss.valueobject.client.CompatableFeatureCustomVO and there is no 
> default value.
> at 
> mx.controls::DataGrid/itemEditorItemEditEndHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\DataGrid.as:4860]
> at flash.events::EventDispatcher/dispatchEventFunction()
> ----------------------------------------------------------
> com.vzw.mpi.rss.valueobject.client.CompatableFeatureCustomVO is the opbject i 
> am using in dataprovider. compatableInd.id is the nested object insde the 
> dataprovider.
> ----------------------------------------------------------
> 
> I am getting the error at itemEditorItemEditEndHandler method of DaatGrid.
> 
> code snippet from DataGrid.as
> 
> if (itemEditorInstance && event.reason != DataGridEventReason.CANCELLED)
>  {
>  var newData:Object = 
> itemEditorInstance[_columns[event.columnIndex].editorDataField];
>  var property:String = _columns[event.columnIndex].dataField;
>  var data:Object = event.itemRenderer.data;
>  var typeInfo:String = "";
>  for each(var variable:XML in describeType(data).variable)
>  {
>  if (property == variab...@... <mailto:variable.%40name.toString> ())
>  {
>  typeInfo = variab...@... <mailto:variable.%40type.toString> ();
>  break;
>  }
>  }
> 
> if (typeInfo == "String")
>  {
>  if (!(newData is String))
>  newData = newData.toString();
>  }
>  else if (typeInfo == "uint")
>  {
>  if (!(newData is uint))
>  newData = uint(newData);
>  }
>  else if (typeInfo == "int")
>  {
>  if (!(newData is int))
>  newData = int(newData);
>  }
>  else if (typeInfo == "Number")
>  {
>  if (!(newData is int))
>  newData = Number(newData);
>  }
>  if (property != null && data[property] !== newData)
>  {
>  bChanged = true;
>  data[property] = newData;
> 
> I debug the code and found that the data refers to 
> com.vzw.mpi.rss.valueobject.client.CompatableFeatureCustomVO and the property 
> refers to compatableInd.id
> 
> when it tries to data[property] it fails
> because
> data[compatableInd] is valid
> data[compatableInd.id] is not valid
> 
> so how to overcome this.
> 
> Any pointer is highly appreciated.
> 
> Thanks
> ilikeflex
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>


Reply via email to