I got it working.  The final solution is:

1. override focusInHandler leave defaultButtonEnabled = true
2. when the drop down (date picker in this case) is shown, set 
defaultButtonEnabled = false when it is shown, true otherwise

Just my opinion, but I think this should have been the implementation 
for ComboBase to begin with.  The only reason I can see wanting to 
disable the defaut button is so that when a drop down (date picker or 
list) is displayed, ENTER works against  that drop down.  Otherwise, 
ENTER should cause default button processing.  Anyway my change makes 
it work this way now.

--- In flexcoders@yahoogroups.com, "rkettrey" <[EMAIL PROTECTED]> wrote:
>
> Thanks for the reply, it got me going in the right direction.  
> Instead of my original code, I simply overrode DataField's 
> focusInHandler (actually implemented in ComboBase) and changed the 
> line:
> 
>     fm.defaultButtonEnabled = false;
> 
> to
> 
>     fm.defaultButtonEnabled = true;
> 
> Now pressing ENTER in the DateField works, with one caveat.  When 
the 
> date picker is up, ENTER should only make the picker close.  This 
> case is being checked currently in ComboBase.keyDownHandler, and I 
> was expecting the existing call in that function to 
> event.stopPropogation (after checking the picker is up and closing 
> it) would stop the ENTER key from being process by the focus sub-
> system.  It does not apparently.  I also tried overriding it and 
> changing it to event.stopImmediatePropogation for the heck of it, 
but 
> it does the same thing.
> 
> What is going on here and any ideas how I can make it eat the event 
> from the focusManager point of view when the picker is up?
> 
> --- In flexcoders@yahoogroups.com, "Alex Harui" <aharui@> wrote:
> >
> > defaultButtonEnabled also need to be changed.
> > 
> >  
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com 
> [mailto:[EMAIL PROTECTED] On
> > Behalf Of rkettrey
> > Sent: Wednesday, October 17, 2007 1:24 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] DateField FlexEvent.ENTER Event?
> > 
> >  
> > 
> > TextInput controls will broadcast the FlexEvent.ENTER event when 
> the 
> > enter key is pressed to simulate the default button being pressed 
> for a 
> > form.
> > 
> > I'd like this same thing to happen on my DateFields. I know that 
> > DateField wants to handle the enter key to do its parsing and 
> closing 
> > of the "drop down" (inherits from ComboBase for the date picker), 
> which 
> > is fine. If it is only handling parsing, though, I would like the 
> > control to broadcast the enter event.
> > 
> > After looking at what the TextInput does, I overrode the 
> keyDownHandler 
> > function in DateField where it handles the ENTER key. At the end 
of 
> > the ENTER key handling scope I added:
> > 
> > dispatchEvent(new FlexEvent(FlexEvent.ENTER));
> > 
> > Everything compiles and it appears to broadcast the event. 
However, 
> > the default button handling does not occur.
> > 
> > Any thoughts?
> >
>


Reply via email to