It could be clearer (especially the last sentence), but it seems to me that
it's telling you what to do, rather than what the SDK will do. But I assume
the Cursor class (which I don't use often, so take this with a grain of
salt) would respect the IUID interface and not require you to specify the
individual fields when trying to seek to a particular instance.

-Josh

On Wed, Nov 26, 2008 at 3:45 AM, erdal <[EMAIL PROTECTED]> wrote:

>  Thanks for the clarification but I have a feeling that I would not be the
> last person make similar assumtions after reading sections like this from
> the Developer's guide.
>
> -- Excerpt from the section 'Data providers and the uid property' ----
>
> "If Flex must consider two or more different objects to be identical, the
> objects must implement the IUID interface so that you can assign the same
> uid value to multiple objects. A typical case where you must implement the
> IUID interface is an application that uses paged collections. As the cursor
> moves through the collection, a particular item might be pulled down from
> the server and released from memory repeatedly. Every time the item is
> pulled into memory, a new object is created to represent the item. If you
> need to compare items for equality, Flex should consider all objects that
> represent the same item to be the same "thing."
>
>
> --- In [email protected], Alex Harui <[EMAIL PROTECTED]> wrote:
> >
> > UID is mainly used by selection management in the list classes. It is not
> used by actionscript for testing object equality
> >
> > From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of erdal
> > Sent: Monday, November 24, 2008 1:32 PM
> > To: [email protected]
> > Subject: [flexcoders] UID, how is it used ?
> >
> >
> > I think I am misinterpreting the uid property usage
> http://livedocs.adobe.com/flex/3/html/help.html?content=about_dataproviders_8.html
> >
> > In a BlazeDS application I am using an ArrayCollection of items (VOs)
> returned from the server. I thought when I implement the iuid interface,
> that will guide flex framework for deciding on objects equality and then I
> can use the getItemIndex(Obj) kind of functions. But It didn't work. So I
> wrote this simple test.
> >
> > I was expecting to see person1 and clone1 would pass equality test. But
> they didn't. What am I missing ? I am actually looking for something I can
> use like Java equals.
> >
> > -- File Person.as
> -----------------------------------------------------------------------------------------
> >
> > package
> > {
> > import mx.core.IUID;
> > public class Person implements IUID {
> > public var _uid:String;
> >
> > public function get uid(): String {
> > return _uid;
> > }
> >
> > public function Person() {
> > }
> >
> > public function set uid(value: String): void {
> > _uid=value;
> > }
> > }
> > }
> >
> > -- File test.mxml --------------------------------------------
> >
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="vertical">
> > <mx:Script>
> > <![CDATA[
> > public function onClick():void
> > {
> > var person1:Person = new Person();
> > var person2:Person = new Person();
> > var clone1:Person = new Person();
> > person1.uid = "1";
> > person2.uid = "2";
> > clone1.uid = "1";
> > trace("UIDs are person1:"+person1.uid+" person2:"+person2.uid+"
> clone1:"+clone1.uid);
> > trace("Is person1 and person2 equal ? " + (person1 == person2));
> > trace("Is person1 and twin1 equal ? " + (person1 == clone1));
> > }
> >
> > ]]>
> > </mx:Script>
> > <mx:Button label="run equality test" click="onClick()" />
> > </mx:Application>
> >
> 
>



-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk

Reply via email to