[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  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 ?




        
        
        



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 
   
 

  




__,_._,___



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

2006-10-14 Thread Matt Chotin












Nope, with Arrays what you did is exactly
the right thing.

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of [EMAIL PROTECTED]
Sent: Thursday, October 12, 2006
8:02 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] binding to
an element of an array (Flex 1.5)



 








Hi everyone, 

I
saw in the documentation that one can't bind to elements of an arrays.

Indeed,
it seems that something like 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 ? 







 
       
 
       
 
       



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 
   
 

  




__,_._,___