The UID thing


Yesterday I had a really experience with Value Objects and Flex’s internal namespace. I had a bare value object which had a property “uid”. It was just a public property declared as int which I used to store Data from a Database. So When I tried to render those items in a TileList I suddenly could only highlight and select one of these items. F*** I thought, damn Flex bugs – so I searched the internet for “Flex UID” which leaded me to a great article on Flex’s internal uid behavior. The thing is, if you have a collection of items and you assign them as a dataprovider of some sort of List, the uid property is automatically added to every Value Object – but not if it is already there. Then Flex assumes you want to create your own uid for every object. So I just renamed the property (because all of those ids where the same at that point) and *bling* it works =)

So remember one thing, NEVER USE A PROPERTY CALLED UID IF IT ISN’T UNIQUE !!!

BTW: The Resizable Window class is still not fixed, I really try to do that as soon as possible.

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: