Here is a little example to show the problem. Run the below and click one of the check boxes (no updates). Is the data source (in this case the xml var) not supposed to update here? Also if i don't set the
 
editorProperty="selected" then i get an error

Property text not found on mx.controls.CheckBox and there is no default value

seems odd

I have tried several variations of the below with hand mad cellrenders each method with different yet unexpected results. For exaple i have it almost working with a cellrender in mxml but the inicial xml boolean value is not being set the checkbox is always starting off checked.
 
 
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" layout="absolute">
 
<mx:Script>
 <![CDATA[
  [Bindable]
  public var oxml:XML=<tasks><tasksinfo><item>This is test item 1</item>
  <active>false</active></tasksinfo><tasksinfo><item>This is test item 2</item>
   <active>true</active></tasksinfo></tasks>;
  
  private function Show_xml(event:Event){
   trace(oxml);
  }
 ]]>
</mx:Script>
 
<mx:XMLListCollection source="{oxml..tasksinfo}" id="DS" />
 
<mx:DataGrid editable="true" dataProvider="{DS}" id="List" width="50%" height="50%">
 <mx:columns>
  <mx:DataGridColumn editable="false" headerText="item" columnName="item" />
  <mx:DataGridColumn editable="true" headerText="Active" width="100"
   columnName="active"
   isCellEditor="true"
   cellRenderer="mx.controls.CheckBox" editorProperty="selected" />
 </mx:columns>
</mx:DataGrid>
<mx:Button click="Show_xml(event)"  label="Show XML" />
 
</mx:Application>
In the actual application i am using an external xml file loaded from the server. I would like to keep it in xml for easy write back and updates.
What is the preffered way to deal with data in this case? Objects would be a pain to serialize etc...
 
Thanks for any insight
 
Jason
 
-----Message d'origine-----
De : flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]De la part de sourcecoderia
Envoyé : lundi 13 mars 2006 12:05
À : flexcoders@yahoogroups.com
Objet : [flexcoders] Problem with datagrid, e4x data, and checkbox cellrenderer. Flex (2.0 b1)

hello all,

When a datagrid is bound to a XMLListCollection which is the result
of a httpservice xml(e4x) load, it loads fine. The data is rendered.
However on one of my col I want a checkbox cellrenderer. When I set
the selected to the value in the dataobject within the renderer it
does not change and I'm getting an error as below.

<warning: unable to bind to property 'terminated' on class 'XML'
(class is not an IEventDispatcher)>

This is the first problem. The other thing is that the checkbox is
not being updated at all. I have to put the value first into an text
input box then bind that to the checkbox. If I bind to the dataobject
directly from the checkbox it is not properly updated.

This works fine when the data from the http service is an object
format, but it seems the e4x format is being either ignored or this
type of binding is not supported.

Any ideas, or experiences with this type of problem?

Thanks

Jason.








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to