You can also see an example of an MXML cell renderer that implements an interface here:
http://livedocs.macromedia.com/flex/20beta1/docs/00001102.html Stephen -----Original Message----- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tobias Patton Sent: Thursday, March 16, 2006 1:36 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Flex2.0 Beta BUG: cellRender/cellEditor You need to put: implements="mx.controls.listclasses.IDropInListItemRenderer" in the declaration of your MXML component. Tobias. -----Original Message----- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of t_msreddy Sent: Thursday, March 16, 2006 10:28 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Flex2.0 Beta BUG: cellRender/cellEditor I not implementing a cellRenderer as AS class instead i do it in the mxml. In mxml I have set and get listData methods. I no where specify that I am implementing the interface. Ss it not implicit in MXMLs that if it has set and get listData methods that it is implementing the IDropInListItemRenderer interface? Creating a cellrenderer in AS is a big mess, which I want to avoid. Can you please tell me how can i implement a interface in mxml? --- In flexcoders@yahoogroups.com, "thunderstumpgesatwork" <[EMAIL PROTECTED]> wrote: > > I have implemented this interface in Beta1 and it works just fine for > me... did you specify "implements IDropInListItemRenderer" in your > class declaration? For example, mine looks like this: > > public class PivotTableCellRenderer extends mx.containers.HBox > implements IDropInListItemRenderer > > The rest (the getter/setter methods) were a cut and paste from the > docs with the exception of TWO things... the internal variable in the > documentation has two underscores (__listData vs _listData) I make > mine all use one underscore. I believe that is better practice. > > Also, the documentation references "FlexEvent.DATA_OBJECT_CHANGED" > which doesn't exist, so I've just called it this way: > > this.dispatchEvent(new Event("dataObjectChanged")); > > > Hope this helps... I always hate the "It works for me" answer, but it > does =) > > good luck, > Thunder > > > --- In flexcoders@yahoogroups.com, "t_msreddy" <t_msreddy@> wrote: > > > > So I understand that editorProperty and cellEndEdit are mutually > > exclusive. They both do the same but for complicated stuff we have to > > use cellEndEdit event hook. But the bug is really in the cellRenderer > > listData object which is never set. When the datagrid is rendered for > > the first time, it cannot depend on cellEndEdit. It will depend on > > dataObject in cellRenderer to render values. And since dataObject cannot > > help in getting the cell indices, we need listData. And the > > documentation says that the cellRenderer has to implement > > IDropInListItemRenderer interface. But it looks like this set and get > > methods are never called and so my listData object is always null. > > --- In flexcoders@yahoogroups.com, "Stephen Gilson" <smgilson@> > > wrote: > > > > > > 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] > > On > > > Behalf Of t_msreddy > > > Sent: Thursday, March 16, 2006 9:59 AM > > > To: flexcoders@yahoogroups.com > > > 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-d > > > etail.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); > > > > > > } > > > > > > 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 > > > > > <http://groups.yahoo.com/gads? t=ms&k=Web+site+design+development&w1=Web+ > > > > > site+design+development&w2=Computer+software+development&w3=Software+ des > > > > > ign+and+development&w4=Macromedia+flex&w5=Software+development+best+p rac > > > tice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ> Computer software > > > development > > > > > <http://groups.yahoo.com/gads? t=ms&k=Computer+software+development&w1=We > > > > > b+site+design+development&w2=Computer+software+development&w3=Softwar e+d > > > > > esign+and+development&w4=Macromedia+flex&w5=Software+development+best +pr > > > actice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw> Software design and > > > development > > > > > <http://groups.yahoo.com/gads? t=ms&k=Software+design+and+development&w1= > > > > > Web+site+design+development&w2=Computer+software+development&w3=Softw are > > > > > +design+and+development&w4=Macromedia+flex&w5=Software+development+be st+ > > > practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ> > > > Macromedia flex > > > > > <http://groups.yahoo.com/gads? t=ms&k=Macromedia+flex&w1=Web+site+design+ > > > > > development&w2=Computer+software+development&w3=Software+design+and+d eve > > > > > lopment&w4=Macromedia+flex&w5=Software+development+best+practice&c=5& s=1 > > > 66&.sig=OO6nPIrz7_EpZI36cYzBjw> Software development best practice > > > > > <http://groups.yahoo.com/gads? t=ms&k=Software+development+best+practice& > > > > > w1=Web+site+design+development&w2=Computer+software+development&w3=So ftw > > > > > are+design+and+development&w4=Macromedia+flex&w5=Software+development +be > > > st+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw> > > > > > > ________________________________ > > > > > > YAHOO! GROUPS LINKS > > > > > > > > > > > > * Visit your group "flexcoders > > > <http://groups.yahoo.com/group/flexcoders> " on the web. > > > > > > * To unsubscribe from this group, send an email to: > > > [EMAIL PROTECTED] > > > <mailto:[EMAIL PROTECTED] subject=Unsubscribe> > > > > > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > > > Service <http://docs.yahoo.com/info/terms/> . > > > > > > > > > ________________________________ > > > > > > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/