There is an example of returning multiple results from a
cell renderer in the Beta 1 doc at: http://livedocs.macromedia.com/flex/20beta1/docs/00001110.html
Basically, you have to handle the cellEndEdit event,
extract the data from the cell editor, and write it directly to the control.
Please let me know if this example is helpful.
Stephen
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of t_msreddy
Sent: Thursday, March 16, 2006 9:59 AM
To: [email protected]
Subject: [flexcoders] Flex2.0 Beta BUG: cellRender/cellEditor
I have posted this question many times in the group, but this time I want
to put it very clearly so that people notice this problem
The BUG is if you cellRenderer implements IDropInListItemRenderer
(where you implement set and get listData methods, refer http://livedocs.macromedia.com/labs/1/flex/langref/index.html?mxml-tag-detail.html&mxml-tags.html),
its set and get listData methods are never invoked. So you cellRenderer's
listData local var is always null.
There are couple of issues here. The problem on hand is related to
cellRenderer/cellEditor for a DataGrid. I really see no value in editorProperty
attribute in datagrid, becuase most of times when you implement a
cellRenderer/cellEditor it will have more than one editable property. So what
will you set the editorProperty. They dont talk about this in the documentation.
They only talk about simple examples which has only one editable property.
Manish suggested that we use a composite label of all the editable properties in
cellRenderer to set to the editorProperty. I am not sure how this works. When
the datagrid sets the editorProperty, it will set the composite label and how
does the cellRenderer know how to split this label to set the values to
appropriate textInput fields in my cellRenderer.
My cell renderer implements mx.controls.listclasses.IDropInListItemRenderer
interface and implements set and get listData methods (see code below), this is
the same code given in the documentation. It says all cellRenderers should
implement these methods. I want to use listData to actually get the cell indices
in my cellRenderer.
// Internal variable for the property
value.
private var __listData:BaseListData;
// Make the listData property bindable.
[Bindable("dataObjectChanged")]
// Define the getter method.
public function get listData():BaseListData
{
trace("WeekHoursCR: get listData called");
return __listData;
}
// Define the setter method, and dispatch an event when the property changes
// to support data binding.
public function set listData(value:! BaseListData):void
{
trace("WeekHoursCR: set listData called");
__listData = value;
//The below line causes compile error in flex2.0 beta.
//dispatchEvent(new FlexEvent(FlexEvent.DATA_OBJECT_CHANGED));
}
// Override the setter method.
override public function set dataObject(value:Object) : void {
if(value != null) {
! &n! bsp;&nbs p; // Use super to set the value in the base class.
super.dataObject = value;
}
trace("WeekHoursCR: set dataObject called ; __listData=" + __listData);
trace("WeekHoursCR: set dataObject called ; dataObject=" + dataObject);
}
private var __listData:BaseListData;
// Make the listData property bindable.
[Bindable("dataObjectChanged")]
// Define the getter method.
public function get listData():BaseListData
{
trace("WeekHoursCR: get listData called");
return __listData;
}
// Define the setter method, and dispatch an event when the property changes
// to support data binding.
public function set listData(value:! BaseListData):void
{
trace("WeekHoursCR: set listData called");
__listData = value;
//The below line causes compile error in flex2.0 beta.
//dispatchEvent(new FlexEvent(FlexEvent.DATA_OBJECT_CHANGED));
}
// Override the setter method.
override public function set dataObject(value:Object) : void {
if(value != null) {
! &n! bsp;&nbs p; // Use super to set the value in the base class.
super.dataObject = value;
}
trace("WeekHoursCR: set dataObject called ; __listData=" + __listData);
trace("WeekHoursCR: set dataObject called ; dataObject=" + dataObject);
}
But when I trace the __listData object is always null. the set and
get methods are never called. I think its a bug in flex2.0 Beta.
If my analysis is wrong please feel free to correct me.
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

