Re: [flexcoders] Re: Capturing ENTER key in a Numeric Stepper

2010-07-11 Thread Nick Middleweek
Hi Andrew.

Can you trap the ENTER (keyCode = 13) on a Numeric Stepper? I've been
failing to do this... :(

When a user presses the ENTER key, I want to perform an operation, such as a
search... So I'm thinking I need to somehow trap the ENTER key and dispatch
a custom event.


Mmmm... Any ideas?


Cheers,
Nick





On 11 July 2010 03:46, Andrew cottag...@gmail.com wrote:



 In my applications I use the change event to fire events( like
 change='doThisThing()'). Seems to work for the number stepper just fine.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Nick
 Middleweek n...@... wrote:
 
  Hello,
 
  I've got a form with a few fields on, one being a numeric stepper. On the
 TextInput, I can test the enter key being pressed using the enter event
 but there doesn't appear to be an equivalent for the numericstepper...

  




-- 
Sent by Nick Middleweek ( { email: n...@middleweek.co.uk, mobile: +44(0)774
035 5424, blog: http://blog.middleweek.co.uk } );


[flexcoders] Re: Capturing ENTER key in a Numeric Stepper

2010-07-11 Thread Andrew
I would probably have an event handler to deal with ALL keystrokes, and within 
that have a switch statement. One case of the switch statement would be

case '13':
var searchValue:int = myNumericStepper.value;
doTheSearch(searchValue);
break;


So when the enter key click is captured, the code goes and looks at the number 
stepper and sends whatever its current value is to the search function.


a

--- In flexcoders@yahoogroups.com, Nick Middleweek n...@... wrote:

 Hi Andrew.
 
 Can you trap the ENTER (keyCode = 13) on a Numeric Stepper? I've been failing 
 to do this... :(
 
 When a user presses the ENTER key, I want to perform an operation, such as a 
 search... So I'm thinking I need to somehow trap the ENTER key and dispatch a 
 custom event.





Re: [flexcoders] Re: Capturing ENTER key in a Numeric Stepper

2010-07-11 Thread Nick Middleweek
Andrew - cheers. My problem was that I am working with a custom Numeric
Stepper, I had extended the base control it so it could support null entries
and to be quite restrictive with the inputs... 0-9, delete key, backspace,
etc... I forgot to include ENTER.. doh! :-)

After your post, I decided to go back to basics and testing and
trace(event.keyCode.toString()) on the keydownHander...


Cheers, it's all sorted. I'm now firing out my own FlexEvent.ENTER from my
custom numberstepper.


nice! :-)




On 11 July 2010 15:31, Andrew cottag...@gmail.com wrote:



 I would probably have an event handler to deal with ALL keystrokes, and
 within that have a switch statement. One case of the switch statement would
 be

 case '13':
 var searchValue:int = myNumericStepper.value;
 doTheSearch(searchValue);
 break;

 So when the enter key click is captured, the code goes and looks at the
 number stepper and sends whatever its current value is to the search
 function.


 a

 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Nick
 Middleweek n...@... wrote:
 
  Hi Andrew.
 
  Can you trap the ENTER (keyCode = 13) on a Numeric Stepper? I've been
 failing to do this... :(
 
  When a user presses the ENTER key, I want to perform an operation, such
 as a search... So I'm thinking I need to somehow trap the ENTER key and
 dispatch a custom event.

  




-- 
Sent by Nick Middleweek ( { email: n...@middleweek.co.uk, mobile: +44(0)774
035 5424, blog: http://blog.middleweek.co.uk } );


[flexcoders] Re: Capturing ENTER key in a Numeric Stepper

2010-07-10 Thread Andrew
In my applications I use the change event to fire events( like 
change='doThisThing()'). Seems to work for the number stepper just fine.

--- In flexcoders@yahoogroups.com, Nick Middleweek n...@... wrote:

 Hello,
 
 I've got a form with a few fields on, one being a numeric stepper. On the 
 TextInput, I can test the enter key being pressed using the enter event but 
 there doesn't appear to be an equivalent for the numericstepper...