I don’t want the whole data record. Just a few fields that you need. Maybe
make a class like this:
[Bindable]
Public class DataClass
{
public funciton DataClass(fee_chosen:int, fee1:int, fee2:int...)
{
this.fee_chosen = fee_chosen;
this.fee1 = fee1;
...
}
public var fee_chosen:int;
public var fee1:int;
...
}
On 2/8/10 5:44 AM, "Laurence" <[email protected]> wrote:
--- In [email protected] <mailto:flexcoders%40yahoogroups.com> ,
"Tracy Spratt" <tr...@...> wrote:
>
> Post it here, the more eyes that look at it the better for you.
>
Know an easy way to export my SQL data as something I can post here? Something
like an SQL to XML conversion, so I can include the data in a text file that
the test-program can read?
> Your DataGrid is not editable, correct? And your render is not set
> as an editor, right?
The data grid IS editable, and one of the columns has renderer-as-editor set.
NOT the column that's giving me the trouble. In fact all the columns have
editable set to false, except one column -- again, NOT the one that's giving me
trouble.
> I assume you have debugged this and have tested to see that the
> dataProvider is set when you set selectedItem? Maybe there is a
> timing issue with the bound dataProvider. Loop over the items to
> make sure the item exists. And make sure it matches the
> selectedIndex. I'd probably suggest you do this any way and use
> selectedItem always.
>
> I would use a conditional, testing for the selectedItem, rather
> than blindly setting selectedIndex every time.
Not 100% certain what you mean here... Check to see if the selectedItem isn't
null? The problem I'm having is not that the selectedItem changes (or appears
to change) when you scroll. It's solely in the drop-down. The data that
appears in the drop-down will change from time-to-time as you scroll -- but the
selected value doesn't change ever, unless you change it manually. And when
you do change it manually, it shows the value it's supposed to show! Then you
re-open the drop-down and THAT show's the correct values, too! That's what's
so weird about this problem.
> Finally, I strongly suggest you move that work into
> commitProperties() The set data() function gets called much more
> often than you may realize.
I've never used the commitProperties() function... What does it do? And when
does it get called? Would that work 100% of the time? Basically you're
telling me to do "super.data = value" in the "set data()" function, then
populate the drop-down and selectedItem stuff in the commitProperties()
function? Is that what you're saying?
I'll be working on writing a test-case -- the biggest part of it seems to be
exporting my data. I can't find a shortcut to doing that. But if you can
answer my above questions, then maybe I won't have to write the test-case?
Anyway, thanks a bunch!
Laurence MacNeill
Mableton, Georgia, USA
--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui