Hi,

Could you try to addBlurEvent after setting focus to true ?

Regards,

2009/6/28 Arnaud Blanchard <[email protected]>

> Hi,
> When I set setFocus on a object it is focussed and immediatly after, an
> onBlur event is send. I did not have this problem on 1.5 with focus
> listener. You can see the code below. "solidify" is call immediatly after we
> have time to see that the area of text has been selected. Maybe the onClick
> event haven't been destroyed ?
>
> Thank for your help,
>
> Nono
>
>
> public void edit()
> {
> this.clear();
> areaOfText = new SuggestBox(Text.suggestions);
> areaOfText.setText(text.content);
> areaOfText.addStyleDependentName(Integer.toString(level));
>
>
> /* PROBLEM HERE */
> areaOfText.getTextBox().addBlurHandler(new BlurHandler(){
> public void onBlur(BlurEvent event) {
> solidify(areaOfText.getText());
> }
> });
> this.add(areaOfText);
> areaOfText.setFocus(true);
> /* END PROBLEM */
> }
>
>
> public void solidify(String newContent)
> {
> if (!newContent.equals(text.content))
> {
> this.text = text.createNewText(newContent);
> this.info = this.info.createNewInfo("text", text.id);
> }
> this.clear();
> label = new Label(text.content);
> label.addStyleDependentName(Integer.toString(level));
>
>
> /* MAYBE PROBLEM HERE */
> label.addClickHandler(new ClickHandler(){
> public void onClick(ClickEvent event) {
> edit();
> }
> });
> this.add(label);
> }
>
> >
>


-- 
Damien Picard
Open Source BPM : http://osbpm.axeiya.com/

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