The list classes track selection by the UID of the object.  If the UIDs
are not unique, the wrong thing will show selection.  If the UID
changes, we probably can't find it to show it is selected.  However, I
still don't get why untyped objects made a difference.  Typed objects
and untyped objects that don't implement IUID still get UID's assigned.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Andrew Longley
Sent: Wednesday, August 13, 2008 2:33 PM
To: [email protected]
Subject: [flexcoders] Re: Datagrid selected item highlight behavior
changes based on dataprovider object

 

Ryan, thank you. That worked. I understand the globally unique ID
and the benefit, from a Flex perspective, of updating objects while
appearing to Flex to be the same object, as described in the link. I
don't understand why that affects the selected style in the datagrid.
It sounds like another copy of the object behind that row of the
datagrid is being created, and because Flex doesn't realize it's the
same object the row you see loses the knowledge that it is selected
and the selected style. If you have further insight I'd appreciate
it, but bottom line, this fixed it for me and I thank you.

Andrew

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Ryan Gravener" <[EMAIL PROTECTED]> wrote:
>
> Have your typed objects implement IUID.
> 
> Read this entry for a better explanation:
> http://ryangravener.com/wordpress/?p=36
<http://ryangravener.com/wordpress/?p=36> 
> 
> On Tue, Aug 12, 2008 at 3:54 PM, Alex Harui <[EMAIL PROTECTED]> wrote:
> 
> > Post an example if it is small.
> >
> >
> > ------------------------------
> >
> > *From:* [email protected]
<mailto:flexcoders%40yahoogroups.com> 
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] *On
> > Behalf Of *Andrew Longley
> > *Sent:* Tuesday, August 12, 2008 12:37 PM
> > *To:* [email protected]
<mailto:flexcoders%40yahoogroups.com> 
> > *Subject:* [flexcoders] Re: Datagrid selected item highlight
behavior
> > changes based on dataprovider object
> >
> >
> >
> > Tim thanks for your response. I have a very simple datagrid
> > implementation and yes, simply changing the objects in the datagrid
> > from untyped to typed alters the behavior of the datagrid with
respect
> > to the look of the selected row. Doesn't matter if I use the objects
> > returned from the server or just manufacture a collection of typed
> > objects.
> >
> > So far I'm using the work-around of manufacturing untyped objects.
> >
> > Andrew
> >
> > --- In [email protected]
<mailto:flexcoders%40yahoogroups.com>  <flexcoders%40yahoogroups.com>,
"Tim
> > Hoff" <TimHoff@> wrote:
> > >
> > > Hmm, strongly typed objects or not, the DataGrid should behave the
> > > same; as long as you're not using selectable="false". Are you sure
> > > it's not something else? Are you doing something on the "change"
> > > event?
> > >
> > > -TH
> > >
> > > --- In [email protected]
<mailto:flexcoders%40yahoogroups.com>  <flexcoders%40yahoogroups.com>,
> > "Andrew Longley" <alongley@>
> > > wrote:
> > > >
> > > > I expect that when I click on a row in a datagrid, the item
gains
> > > the
> > > > "selected" row highlight. I'm developing an Air app and my
datagrid
> > > > does not act this way. After much messing around I discovered
that,
> > > > everything else being the same, if I changed the dataProvider
of the
> > > > datagrid the behavior of the datagrid changed.
> > > >
> > > > 1. if the dataProvider is an ArrayCollection of untyped objects,
> > > i.e.,
> > > > {name:"blah",phone:"1231231234"}, it performs as expected, i.e.,
> > > when
> > > > you click on a row it gains the "selected row" highlight
> > > >
> > > > 2. if the dataProvider is an ArrayCollection of typed objects,
i.e.,
> > > > User objects with name and phone attributes, it performs
> > > differently.
> > > > While the datagrid knows that a row is selected, the selected
row
> > > > looks as if it is unselected.
> > > >
> > > > Now it is slightly more complicated in that the User object
extends
> > > > another base class and both use the Bindable metadata tag and
are
> > > > RemoteClassed to Java objects on the server, and have another 30
> > > > attributes.. but I'm still stymied. Anyone have a suggestion for
a
> > > > work-around besides creating untyped objects for every object at
> > > > runtime? What would the code look like to force a selected
style to
> > > > show up for the selected row?
> > > >
> > > > Thanks.
> > > > Andrew
> > > >
> > >
> >
> > 
> >
> 
> 
> 
> -- 
> Ryan Gravener
> http://twitter.com/ryangravener <http://twitter.com/ryangravener> 
>

 

Reply via email to