[flexcoders] keeping server object relationships

2007-03-16 Thread dgigon
Hi everyone,

Here is a simple design question on which I'd like to have your opinion :

made short : How to keep server object relationships in flex when you do 
several 
calls


Take an example :

2 companies, say Apple and Microsoft, have several clients, among them, 
say Macromedia. (relation Company-Client)
Let's make a flex application which requests (server call) and displays 
all the clients of a selected company.

If I make a first remote call to get Apple's clients, Flex will receive a list 
of objects including an 
Client object for Macromedia.
Later, I select Microsoft, and get Bill Gate's clients. Flex will receive 
another list of objets, including another version of the
Client object for Macromedia.

Although it is the same Macromedia client object on the server, I have now 2 
distinct Macromedia client object in my Flex Application.
And if, for example, I change the name of one Macromedia object to (purely 
fiction) Adobe, the change won't apply on the other objet ...

Damien



[flexcoders] binding to an element of an array (Flex 1.5)

2006-10-12 Thread dgigon




Hi everyone,

I saw in the documentation that one can't bind to elements of an arrays.
Indeed, it seems that something like label text={someArray[1]}/ does nothing.

I searched through the mailing list archive and made some tests myself, but couldn't find
something really simple.

- The first step seems to put : 
someArray.replaceItemAt(1, item) instead of someArray[1] = item
The reason is that it will make someArray dispatch a modelChanged event.

- I tried several things, including using mx:Model or mx:Binding tags to make the linkage, 
but then I doesn't work, and I couldn't find anyhting better than :
someArray.addEventListener(modelChanged, this);
With an event handling function that does the binding.

Although it is working, it looks a bit dirty. I hope there is some way to do it without any actionscript lines,
just like the other bindings.


- Here is a little example of something that I took as a starting example. What can be done to make it work ?

mx:Script
![CDATA[
var sourceArray = [ one, two, three ]; 
]]
/mx:Script
mx:TextInput id=sourceText text=Replace It ! /
mx:Button label=Update data click=sourceArray.replaceItemAt(1, sourceText.text); /
mx:Label text=sourceArray.getItemAt(1)='{ sourceArray.getItemAt(1) }' /



Thanks,
Damien
__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___