[flexcoders] Force binding for Arrays

2005-11-03 Thread superabe superabe



I realize that we can force binding for Arrays to occur, when modifying one of their indexes by doing something like

Model.myList = Model.myList

Is there any performance reasons or other reasons why this would be a bad idea to use?

TIA
- superabe






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





  




  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









Re: [flexcoders] Force binding for Arrays

2005-11-03 Thread JesterXL





You don't need to do that; Array's in Flex already 
have the DataProvider API (in 1.5), and thus generate events.
So, if you are changing an index, ensure you do:

my_array.addItem(someItem)

Instead of:

my_array.push(someItem)

If you do the addItem, it'll trigger the event, and update whatever 
controls is bound to the array. Only reset the array entirely if the whole 
array changes.

- Original Message - 
From: superabe superabe 

To: flexcoders@yahoogroups.com 
Sent: Thursday, November 03, 2005 11:11 AM
Subject: [flexcoders] Force binding for Arrays

I realize that we can force binding for Arrays to occur, when modifying one 
of their indexes by doing something like

Model.myList = Model.myList

Is there any performance reasons or other reasons why this would be a bad 
idea to use?

TIA
- 
superabe





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

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









Re: [flexcoders] Force binding for Arrays

2005-11-03 Thread superabe superabe



ok...I do need to reset the array at times, and also to change an item in the index.
Is there any perf hit by reassiging the variable to itself ?

- superabe
On 11/3/05, JesterXL [EMAIL PROTECTED] wrote:

You don't need to do that; Array's in Flex already have the DataProvider API (in 1.5), and thus generate events.
So, if you are changing an index, ensure you do:

my_array.addItem(someItem)

Instead of:

my_array.push(someItem)

If you do the addItem, it'll trigger the event, and update whatever controls is bound to the array. Only reset the array entirely if the whole array changes.

 
- Original Message - 
From: superabe superabe 
To: flexcoders@yahoogroups.com 
Sent: Thursday, November 03, 2005 11:11 AM
Subject: [flexcoders] Force binding for Arrays

I realize that we can force binding for Arrays to occur, when modifying one of their indexes by doing something like

Model.myList = Model.myList

Is there any performance reasons or other reasons why this would be a bad idea to use?

TIA
- superabe--Flexcoders Mailing ListFAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txtSearch Archives: 
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
SPONSORED LINKS 




Web site design development 

Computer software development 

Software design and development 


Macromedia flex 


YAHOO! GROUPS LINKS 

Visit your group flexcoders on the web. 
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED] 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 










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

Web site design development
  
  
Software design and development
  
  
Macromedia flex
  
  


Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









Re: [flexcoders] Force binding for Arrays

2005-11-03 Thread JesterXL





Yep; you pretty much reset the entire 
component. However, most that I've seen don't necessarely do a reset vs. 
an array.removeAll() differently; you're just re-creating a few variables so go 
for it G!

- Original Message - 
From: superabe superabe 

To: flexcoders@yahoogroups.com 
Sent: Thursday, November 03, 2005 8:28 PM
Subject: Re: [flexcoders] Force binding for Arrays

ok...I do need to reset the array at times, and also to change an item in 
the index.
Is there any perf hit by reassiging the variable to itself ?

- superabe
On 11/3/05, JesterXL 
[EMAIL PROTECTED] 
wrote: 

  You don't need to do that; Array's in Flex 
  already have the DataProvider API (in 1.5), and thus generate 
  events.
  So, if you are changing an index, ensure you do:
  
  my_array.addItem(someItem)
  
  Instead of:
  
  my_array.push(someItem)
  
  If you do the addItem, it'll trigger the event, and update whatever 
  controls is bound to the array. Only reset the array entirely if the 
  whole array changes.
  
   
  - Original Message - 
  From: superabe superabe 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, November 03, 2005 11:11 AM
  Subject: [flexcoders] Force binding for Arrays
  
  I realize that we can force binding for Arrays to occur, when modifying 
  one of their indexes by doing something like
  
  Model.myList = Model.myList
  
  Is there any performance reasons or other reasons why this would be a bad 
  idea to use?
  
  TIA
  - superabe--Flexcoders Mailing 
  ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txtSearch 
  Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
  
  SPONSORED 
  LINKS 
  


  Web site design development 
  Computer software development 
  Software design and development 

  Macromedia flex 
  
  
  YAHOO! GROUPS LINKS 
  
Visit your group "flexcoders" on the web. 
To unsubscribe from this group, send an email 
to: [EMAIL PROTECTED] 

Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service. 
  
  
  





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

Web site design development
  
  
Software design and development
  
  
Macromedia flex
  
  


Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









RE: [flexcoders] Force binding for Arrays

2005-11-03 Thread Matt Chotin










Its not the end of the world in
Flex 1.5, it will not be a good idea in Flex 2 (but we provide new interfaces
to make it even easier). It also depends what the binding destination is doing
with the array. If its a DataGrid theres a lot more invalidating
and redrawing that happens if you re-assign the whole array vs. just notifying
it that one item changed. Repeater is even worse. Something that is just
holding a reference, less of a big deal. My guess is that you are binding to
something that does react to the array and therefore there is a performance
impact in redrawing all the time.



Matt











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of superabe superabe
Sent: Thursday, November 03, 2005
5:28 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Force
binding for Arrays







ok...I do need to reset the array at times, and also to change an item
in the index.





Is there any perf hit by reassiging the variable to itself ?











- superabe







On 11/3/05, JesterXL
[EMAIL PROTECTED]
wrote: 



You don't need to do that; Array's in Flex already have the
DataProvider API (in 1.5), and thus generate events.






So, if you are changing an index, ensure you do:











my_array.addItem(someItem)











Instead of:











my_array.push(someItem)











If you do the addItem, it'll trigger the event, and update
whatever controls is bound to the array. Only reset the array entirely if
the whole array changes.





 



- Original Message - 



From: superabe
superabe 





To: flexcoders@yahoogroups.com 





Sent: Thursday, November
03, 2005 11:11 AM





Subject: [flexcoders] Force
binding for Arrays














I realize that we can force binding for Arrays to occur, when modifying
one of their indexes by doing something like











Model.myList = Model.myList











Is there any performance reasons or other reasons why this would be a
bad idea to use?











TIA





- superabe












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




 
  
  Web site design development 
  
  
  Computer software development 
  
  
  Software design and development 
  
 
 
  
  Macromedia flex 
  
  
  
  
  
  
  
 










YAHOO!
GROUPS LINKS





 Visit your group
 flexcoders
 on the web.
 
 To unsubscribe
 from this group, send an email to:
  [EMAIL PROTECTED]
 
 Your use of
 Yahoo! Groups is subject to the Yahoo! Terms of Service.





















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





  




  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.