If I'm understanding your email correctly, you're actually looking at a feature 
of Data Management. When you fill multiple client side collections and there's 
an overlap in the items each collection contains, Data Management ensures that 
only a single instance of any specific item exists on the client. This 
guarantees that your client side-data remains in a consistent state. Say you 
had two copies of 'media1' on the client, and then you change one and then the 
other. Which copy is the true copy? Which should be committed back to the 
server? There's no way to know, and this is a problem folks hit when using 
simple remoting to manage data. By maintaining a single instance on the client, 
your client-side data stays in a consistent, well-understood state.

If your media instances really shouldn't be shared by your model instances, 
then you'll need to adjust your domain model (always create unique media 
instances for each model?).

Seth

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Thierry 
V.
Sent: Wednesday, June 11, 2008 2:39 AM
To: [email protected]
Subject: [flexcoders] lcds references to same item

Hello all !

I use LCDS to retrieve data from my database and display it on a tree.

I have the following tables : model, model_media and media.

I have made an hibernate "model" mapping with a Set from model to 
model_media, to get for each model their medias, like this :

<set name="children" table="model_media" lazy="false">
<key column="modelid" />
<many-to-many column="mediaid" class="MediaVO" />
</set>

I could retrieve data correctly, each model have their own media listed 
in the "children" Set. Some medias are used by several models at same 
time, for exemple :

model1
- media1
- media2
- media3

model2
- media1
- media3
- media4

Now, when I display my hierarchical list into a Tree, there is stange 
behaviours... When I display all the hierarchy for all models, and roll 
over an item used several times, the selection focus is displayed on the 
last item... ie if I roll over the media1 from model1, the focus is 
displayed on the media1 from model2... It seems that the items used some 
times are referenced at the same memory allocation... Flex doesn't 
recognize each item as single item, it see item used several times as 
the same item...

Anybody have encounted the same behaviours ?? I don't know how to 
resolve it...

any suggestion are welcome, thanks in advance

Thierry
 

Reply via email to