views:

428

answers:

2

Hello,

I have a very strange problem in a Flex 3.4 Datagrid. One of the columns is a ComboBox - I have my own custom renderer for the ComboBox. I use it to select my data and then make a "save" to the db. Upon return the comboBox loses its value. Even stranger is that when I scroll the datagrid area to the left (by moving scrollbar right) - the values in the ComboBox change!! When I scroll the datagrid right (by moving the scrollbar left) - the values in the ComboBox don't change.

Has anyone seen anything remotely like this in a Flex app?

Thanks

Khalid

+1  A: 

Item renderers get recylced, and its a pain sometimes!

Have a read here and google this

Basically you need to reset your values.

Hope this helps!

Jammin
Jammin - you are truely a star!Firstly I could not believe that you answered my question within 1 minute of my posting it! Surely thats a new record, even for StackOverflow?Second - I read the article by Alex - and learnt about renderer recycling. I'm used to Java Swing GUI (and even MFC), so this was quite a new (and confusing) concept for me. Still - managed to crack it after 2 hours. Can't say I *fully* understand it - but hey - it works!Thanks again.Khalid
Tenakha
A: 

Hi,

In your custom renderer are you overriding the data setter?? Can you paste some code??

Gus

Gus
Hi Gus,I have modified the validateNow() method in the ComboBoxRender to work out what data it requires for each row, and that seemed to do the trick.Thanks for your reply.Khalid
Tenakha