Re: [flexcoders] Re: Binding scroll position to the selected index

2006-10-13 Thread Michael Schmalle



Hi,Have you tried the selectedItemChanged event from the list?Just write a handler and do what Tim said, maybe that would work.Peace, Mike
On 10/12/06, Daniel Wabyick [EMAIL PROTECTED] wrote:













  




Ah, that was a good idea, but it doesn't work in my case.

The list is being filtered and the selectedItem is being set via other 
code. Thus the need to bind to selectedItem, as the change handler 
won't be called.

I should be able to whip something up fairly easily via a subclass ...

-D

Tim Hoff wrote:

 Hi Daniel,

 On a click or change event you could use this:

 myList.scrollToIndex(myList.selectedIndex);

 -TH

 --- In flexcoders@yahoogroups.com 
 mailto:flexcoders%40yahoogroups.com, Daniel Wabyick [EMAIL PROTECTED] wrote:

 
 
  I would like to configure a List class so that it will automatically
  scroll to show the selected item whenever the selected index/item
  changes. I can't see anyway to bind that using the standard List
 class,
  and it seems like I will have to subclass it in order to work. Am I
  missing an easier solution?
 
  Thanks,
  -D
 

  


  













-- What goes up, does come down.

__._,_.___





--
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] Re: Binding scroll position to the selected index

2006-10-13 Thread Daniel Wabyick

I don't see a selectedItemChanged event ... I only see a change event, 
and that only gets fired when a user manually clicks and changes an item.


Michael Schmalle wrote:

 Hi,

 Have you tried the selectedItemChanged event from the list?

 Just write a handler and do what Tim said, maybe that would work.

 Peace, Mike

 On 10/12/06, *Daniel Wabyick* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:


 Ah, that was a good idea, but it doesn't work in my case.

 The list is being filtered and the selectedItem is being set via
 other
 code. Thus the need to bind to selectedItem, as the change handler
 won't be called.

 I should be able to whip something up fairly easily via a subclass ...

 -D

 Tim Hoff wrote:
 
  Hi Daniel,
 
  On a click or change event you could use this:
 
  myList.scrollToIndex(myList.selectedIndex);
 
  -TH
 
  --- In flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
  mailto:flexcoders% mailto:flexcoders%2540yahoogroups.com
 http://40yahoogroups.com, Daniel Wabyick [EMAIL PROTECTED] wrote:
  
  
   I would like to configure a List class so that it will
 automatically
   scroll to show the selected item whenever the selected index/item
   changes. I can't see anyway to bind that using the standard List
  class,
   and it seems like I will have to subclass it in order to work. Am I
   missing an easier solution?
  
   Thanks,
   -D
  
 
 




 -- 
 What goes up, does come down.
  



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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 



[flexcoders] Re: Binding scroll position to the selected index

2006-10-12 Thread Tim Hoff
Hi Daniel,

On a click or change event you could use this:

myList.scrollToIndex(myList.selectedIndex);

-TH

--- In flexcoders@yahoogroups.com, Daniel Wabyick [EMAIL PROTECTED] wrote:

 
 I would like to configure a List class so that it will automatically 
 scroll to show the selected item whenever the selected index/item 
 changes.  I can't see anyway to bind that using the standard List 
class, 
 and it seems like I will have to subclass it in order to work.  Am I 
 missing an easier solution?
 
 Thanks,
 -D






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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 



Re: [flexcoders] Re: Binding scroll position to the selected index

2006-10-12 Thread Daniel Wabyick

Ah, that was a good idea, but it doesn't work in my case.

The list is being filtered and the selectedItem is being set via other 
code. Thus the need to bind to selectedItem, as the change handler 
won't be called.

I should be able to whip something up fairly easily via a subclass ...

-D




Tim Hoff wrote:

 Hi Daniel,

 On a click or change event you could use this:

 myList.scrollToIndex(myList.selectedIndex);

 -TH

 --- In flexcoders@yahoogroups.com 
 mailto:flexcoders%40yahoogroups.com, Daniel Wabyick [EMAIL PROTECTED] 
 wrote:
 
 
  I would like to configure a List class so that it will automatically
  scroll to show the selected item whenever the selected index/item
  changes. I can't see anyway to bind that using the standard List
 class,
  and it seems like I will have to subclass it in order to work. Am I
  missing an easier solution?
 
  Thanks,
  -D
 

  



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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 



[flexcoders] Re: Binding scroll position to the selected index

2006-10-12 Thread Tim Hoff



Ok, subclass yes. Or, you could watch for the change of the selectedIndex with the Observe tag. Alex Uhlmann has a good article here:
http://weblogs.macromedia.com/auhlmann/archives/2006/09/using_binding_s.cfm#more
-TH--- In flexcoders@yahoogroups.com, Daniel Wabyick [EMAIL PROTECTED] wrote:  Ah, that was a good idea, but it doesn't work in my case.  The list is being filtered and the selectedItem is being set via other  code. Thus the need to bind to selectedItem, as the "change" handler  won't be called.  I should be able to whip something up fairly easily via a subclass ...  -D Tim Hoff wrote:   Hi Daniel,   On a click or change event you could use this:   myList.scrollToIndex(myList.selectedIndex);   -TH   --- In flexcoders@yahoogroups.com   mailto:flexcoders%40yahoogroups.com, Daniel Wabyick daniel@ wrote:   I would like to configure a List class so that it will automatically   scroll to show the selected item whenever the selected index/item   changes. I can't see anyway to bind that using the standard List  class,   and it seems like I will have to subclass it in order to work. Am I   missing an easier solution? Thanks,   -D

__._,_.___





--
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] Re: Binding scroll position to the selected index

2006-10-12 Thread Tracy Spratt












Did you try the commitValue event?



Tracy











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tim Hoff
Sent: Thursday, October 12, 2006
6:23 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Binding
scroll position to the selected index











Ok,
subclass yes. Or, you could watch for the change of the selectedIndex
with the Observe tag. Alex Uhlmann has a good article here:

http://weblogs.macromedia.com/auhlmann/archives/2006/09/using_binding_s.cfm#more

-TH

--- In [EMAIL PROTECTED]ups.com,
Daniel Wabyick [EMAIL PROTECTED] wrote:

 
 Ah, that was a good idea, but it doesn't work in my case.
 
 The list is being filtered and the selectedItem is being set via other 
 code. Thus the need to bind to selectedItem, as the change
handler 
 won't be called.
 
 I should be able to whip something up fairly easily via a subclass ...
 
 -D
 
 
 
 
 Tim Hoff wrote:
 
  Hi Daniel,
 
  On a click or change event you could use this:
 
  myList.scrollToIndex(myList.selectedIndex);
 
  -TH
 
  --- In [EMAIL PROTECTED]ups.com

  mailto:flexcoders%40yahoogroups.com, Daniel Wabyick
daniel@ wrote:
  
  
   I would like to configure a List class so that it will
automatically
   scroll to show the selected item whenever the selected
index/item
   changes. I can't see anyway to bind that using the standard List
  class,
   and it seems like I will have to subclass it in order to work.
Am I
   missing an easier solution?
  
   Thanks,
   -D
  
 
 







__._,_.___





--
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] Re: Binding scroll position to the selected index

2006-10-12 Thread Daniel Wabyick

So, I got both the valueCommit and the Observe / tag to work when 
manually setting list.selectedIndex, but not the list.selectedItem property.

You can check out either version ... For those without the Observe / 
tag, just remove those two ... They appear to be functionally equivalent 
in this case.

?xml version=1.0?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
xmlns:local=* xmlns:ac=com.adobe.ac.*
   
   
mx:Script
![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var dp : ArrayCollection = new ArrayCollection( [{ 
name:test1 }, { name:test2 }, { name:test3 }, { name:test4 }, { 
name:test5 }, { name:test6 }, { name:test7 }, { name:test8 }, { 
name:test9 }] );
]]
/mx:Script
   
mx:NumericStepper id=stepper minimum=1 maximum=10 /
   
mx:List id=scrollList selectedIndex={ stepper.value } 
dataProvider={ dp } width=150 valueCommit={ 
scrollList.scrollToIndex( scrollList.selectedIndex ) }  labelField=name/
!--mx:List id=scrollList selectedItem={ dp.getItemAt( 
stepper.value ) }  dataProvider={ dp } width=150 valueCommit={ 
scrollList.scrollToIndex( scrollList.selectedIndex ) }  labelField=name/
--
   
mx:List id=scrollList2 selectedIndex={ stepper.value }  
dataProvider={ dp } width=150 labelField=name /
!--mx:List id=scrollList2 selectedItem={ dp.getItemAt( 
stepper.value ) }  dataProvider={ dp } width=150 labelField=name 
/--
ac:Observe source={ scrollList2.selectedIndex }  handler={ 
function() : void { scrollList2.scrollToIndex( scrollList2.selectedIndex 
) } } /
   
mx:Button click={ scrollList.selectedIndex = 10; 
scrollList2.selectedIndex = 10 } label=Scroll to end  /
/mx:Application



Tracy Spratt wrote:

 Did you try the commitValue event?

  

 Tracy

  

 

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
 *On Behalf Of *Tim Hoff
 *Sent:* Thursday, October 12, 2006 6:23 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] Re: Binding scroll position to the selected index

  

 Ok, subclass yes.  Or, you could watch for the change of the 
 selectedIndex with the Observe tag.  Alex Uhlmann has a good article here:

 http://weblogs.macromedia.com/auhlmann/archives/2006/09/using_binding_s.cfm#more
  
 http://weblogs.macromedia.com/auhlmann/archives/2006/09/using_binding_s.cfm#more
  

 -TH

 --- In flexcoders@yahoogroups.com, Daniel Wabyick [EMAIL PROTECTED] wrote:
 
 
  Ah, that was a good idea, but it doesn't work in my case.
 
  The list is being filtered and the selectedItem is being set via other
  code. Thus the need to bind to selectedItem, as the change handler
  won't be called.
 
  I should be able to whip something up fairly easily via a subclass ...
 
  -D
 
 
 
 
  Tim Hoff wrote:
  
   Hi Daniel,
  
   On a click or change event you could use this:
  
   myList.scrollToIndex(myList.selectedIndex);
  
   -TH
  
   --- In flexcoders@yahoogroups.com
   mailto:flexcoders%40yahoogroups.com, Daniel Wabyick daniel@ wrote:
   
   
I would like to configure a List class so that it will automatically
scroll to show the selected item whenever the selected index/item
changes. I can't see anyway to bind that using the standard List
   class,
and it seems like I will have to subclass it in order to work. Am I
missing an easier solution?
   
Thanks,
-D
   
  
  
 

  



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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 



[flexcoders] Re: Binding scroll position to the selected index

2006-10-12 Thread Tim Hoff
Tracy,

Thanks for the valueCommit suggestion.  You shed a new light on that 
event: a lot less code your way. :)

-TH

--- In flexcoders@yahoogroups.com, Daniel Wabyick [EMAIL PROTECTED] wrote:

 
 So, I got both the valueCommit and the Observe / tag to work 
when 
 manually setting list.selectedIndex, but not the list.selectedItem 
property.
 
 You can check out either version ... For those without the 
Observe / 
 tag, just remove those two ... They appear to be functionally 
equivalent 
 in this case.
 
 ?xml version=1.0?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
 xmlns:local=* xmlns:ac=com.adobe.ac.*


 mx:Script
 ![CDATA[
 import mx.collections.ArrayCollection;
 [Bindable]
 private var dp : ArrayCollection = new ArrayCollection
( [{ 
 name:test1 }, { name:test2 }, { name:test3 }, { 
name:test4 }, { 
 name:test5 }, { name:test6 }, { name:test7 }, { 
name:test8 }, { 
 name:test9 }] );
 ]]
 /mx:Script

 mx:NumericStepper id=stepper minimum=1 maximum=10 /

 mx:List id=scrollList selectedIndex={ stepper.value } 
 dataProvider={ dp } width=150 valueCommit={ 
 scrollList.scrollToIndex( scrollList.selectedIndex ) }  
labelField=name/
 !--mx:List id=scrollList selectedItem={ dp.getItemAt( 
 stepper.value ) }  dataProvider={ dp } width=150 
valueCommit={ 
 scrollList.scrollToIndex( scrollList.selectedIndex ) }  
labelField=name/
 --

 mx:List id=scrollList2 selectedIndex={ stepper.value }  
 dataProvider={ dp } width=150 labelField=name /
 !--mx:List id=scrollList2 selectedItem={ dp.getItemAt( 
 stepper.value ) }  dataProvider={ dp } width=150 
labelField=name 
 /--
 ac:Observe source={ scrollList2.selectedIndex }  handler={ 
 function() : void { scrollList2.scrollToIndex( 
scrollList2.selectedIndex 
 ) } } /

 mx:Button click={ scrollList.selectedIndex = 10; 
 scrollList2.selectedIndex = 10 } label=Scroll to end  /
 /mx:Application
 
 
 
 Tracy Spratt wrote:
 
  Did you try the commitValue event?
 
   
 
  Tracy
 
   
 
  -
---
 
  *From:* flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] 
  *On Behalf Of *Tim Hoff
  *Sent:* Thursday, October 12, 2006 6:23 PM
  *To:* flexcoders@yahoogroups.com
  *Subject:* [flexcoders] Re: Binding scroll position to the 
selected index
 
   
 
  Ok, subclass yes.  Or, you could watch for the change of the 
  selectedIndex with the Observe tag.  Alex Uhlmann has a good 
article here:
 
  
http://weblogs.macromedia.com/auhlmann/archives/2006/09/using_binding
_s.cfm#more 
  
http://weblogs.macromedia.com/auhlmann/archives/2006/09/using_bindin
g_s.cfm#more 
 
  -TH
 
  --- In flexcoders@yahoogroups.com, Daniel Wabyick daniel@ 
wrote:
  
  
   Ah, that was a good idea, but it doesn't work in my case.
  
   The list is being filtered and the selectedItem is being set 
via other
   code. Thus the need to bind to selectedItem, as the change 
handler
   won't be called.
  
   I should be able to whip something up fairly easily via a 
subclass ...
  
   -D
  
  
  
  
   Tim Hoff wrote:
   
Hi Daniel,
   
On a click or change event you could use this:
   
myList.scrollToIndex(myList.selectedIndex);
   
-TH
   
--- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com, Daniel Wabyick 
daniel@ wrote:


 I would like to configure a List class so that it will 
automatically
 scroll to show the selected item whenever the selected 
index/item
 changes. I can't see anyway to bind that using the 
standard List
class,
 and it seems like I will have to subclass it in order to 
work. Am I
 missing an easier solution?

 Thanks,
 -D

   
   
  
 
 






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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/