0

I have one link on click of that link one can edit the name of that link in the text box.

enter image description here

After editing save and close options are there. after saving this the focus goes out from the link i need that focus must be stay there on the link.

enter image description here

I am using

Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute () {
    link.setFocus(true);
}
});

for the link but it will focus for a second only not permanently to that link. Looking for solution.

Thanks..!!

Vaibhav Jain
  • 3,729
  • 3
  • 25
  • 42

1 Answers1

0

Use the following code inside your close and save button clickhandler.

Scheduler.get().scheduleDeferred(new ScheduledCommand() {
    public void execute () {
        link.setFocus(true);
    }
});.
pratZ
  • 3,078
  • 2
  • 20
  • 29
  • yes. setFocus in GWT i am always using inside the scheduler.get().....!! This is not working – Vaibhav Jain Jul 19 '13 at 07:12
  • using this code inside (not outside) the `clickhandler` of your close and save button, i don't see a point the link to lose its focus. I have faced similar issues but this works fine for me. – pratZ Jul 19 '13 at 07:27