Hi all,

I am using a SuggestBox but i have added a prompt on it.
It shows "Enter a number" when focus is not on SuggestBox and when
focus is set on suggestbox i set the text to "" using focuslistner.
This works fine on all other browsers but when i try it on Chrome i
have to click on suggestBox and then drag the mouse and then only the
suggest box text is set to "".

Here is the code

FocusListener OnFieldFocus = new FocusListener()
    {
        public void onFocus( Widget sender)
        {
                SuggestBox sb = (SuggestBox)sender;
                if (sb != null)
                {

                        if ( sb.getText().equals("Enter a number")))
                                sb.setText("");


                }
        }
        public void onLostFocus(Widget sender)
        {
                SuggestBox sb = (SuggestBox)sender;
                if (sb != null)
                {
                        if (sb.getText().trim().length() == 0)
                        {
                                sb.setText("Enter a number"));

                        }
                }

        }
    };

thanks & regards
Sandeep
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
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