Now I think I just found the solution. I have to use a MouseListener
on the popup the set a flag whether the mouse is inside of the popop
or outside. So I know whether the mouse is inside the popup when the
textbox loses its focus or not. If it is inside the popup, onLostFocus
should not be fired immediatly, but after the popup is hidden.

I did not have time to try that, but I think it will work.

Anyway thanks for your help. Jakob


On Sep 15, 7:21 pm, "jakob.korherr" <[EMAIL PROTECTED]> wrote:
> I just found a better related issue:
>
> http://code.google.com/p/google-web-toolkit/issues/detail?id=729
>
> I have to use onLostFocus just because onEventPreview does not work
> properly and so the popup does not close automatically.
>
> On Sep 15, 5:59 pm, "jakob.korherr" <[EMAIL PROTECTED]> wrote:
>
> > It seems like, but "I found a workaround: using DeferredCommand solves
> > the problem." does not work for me.
>
> > On Sep 15, 4:33 pm, walden <[EMAIL PROTECTED]> wrote:
>
> > > Jakob,
>
> > > I was just playing around with SuggestBox, selecting with mouse vs
> > > selecting with keyboard, and I see the problem.  I think it's a bug,
> > > and it seems to be covered by issue 
> > > 1634:http://code.google.com/p/google-web-toolkit/issues/detail?id=1634&q=S...
>
> > > "The suggest tab should be considered the same "focus" area as the
> > > TextBox and should not fire an on change unless the text is updated
> > > from suggestion or the user focuses outside the entire widget."
>
> > > Walden
>
> > > On Sep 15, 9:13 am, "jakob.korherr" <[EMAIL PROTECTED]> wrote:
>
> > > > In my case it really is. I am using the SuggestBox as a kind of quick
> > > > navigation.
>
> > > > I am hosting a little social network with many forums, clubs, picture
> > > > galleries and so on and if the user wants to go e.g. to the club
> > > > 'Programming', he just has to type e.g. 'program' in the TextBox and
> > > > the SuggestBox will display the club. If the user than selects the
> > > > suggestion, he will be forwared to the club. So the SuggestionPopup
> > > > has to be hidden after the user selection, which it does
> > > > automatically. However if some suggestions are displayed and the user
> > > > click outside of the TextBox and outside of the Popup, the SuggestBox
> > > > should be disabled and the Popup hidden. That's why I am using the
> > > > FocusListener. Unfortunately it does not work the way I want.
>
> > > > Now I am thinking of changing the SuggestBox and adding a EventPreview
> > > > to the Popup, so that I can handle the events better. Then I will
> > > > change the FocusListener so that it only fires onLostFocus when the
> > > > user clicks outside of the TextBox AND the Popup. I hope I can manage
> > > > that..
>
> > > > On Sep 15, 3:02 pm, walden <[EMAIL PROTECTED]> wrote:
>
> > > > > Usability: if you disable the SB as soon as a suggestion is chosen,
> > > > > you prevent the user from correcting an errant selection.  Are you
> > > > > sure this is the right time to disable the box?  Is there a good
> > > > > reason to do this?
>
> > > > > On Sep 14, 11:56 am, "jakob.korherr" <[EMAIL PROTECTED]>
> > > > > wrote:
>
> > > > > > Hi Ian - thanks for this fast reply!
>
> > > > > > I tried your suggestion, but it has the same affect. onLostFocus and
> > > > > > onChange are both fired before the Item is selected.
>
> > > > > > Any other ideas?
>
> > > > > > On Sep 14, 5:18 pm, "Ian Petersen" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > On Sun, Sep 14, 2008 at 11:05 AM, jakob.korherr
>
> > > > > > > <[EMAIL PROTECTED]> wrote:
> > > > > > > > Has anyone got an idea to solve this problem?
>
> > > > > > > Why are you disabling the SuggestBox on loss of focus?  Can you
> > > > > > > disable it on change of value, instead?
>
> > > > > > > Ian- Hide quoted text -
>
> > > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to