Bug 281989 - Control#setFocus works wrong in some cases
Summary: Control#setFocus works wrong in some cases
Status: RESOLVED WORKSFORME
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2009-06-30 06:44 EDT by Igor Pavlenko CLA
Modified: 2010-01-12 03:20 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Pavlenko CLA 2009-06-30 06:44:47 EDT
I have a wizard with one wizard page inside.
I have a Text element on this page and I have to setFocus on that element.

I tryed to do this in the IDialogPage#createControl method. I put a line of code "m_text.setFocus()" at the end of implementation of createControl method. It is works fine on RCP. It also works in IE7. But it does not work in FF3.

The behaviour is very strange. I also have a ModifyListener on my Text control. I have several problems with Text control in that case:

1) The cursor is not set on my Text control where wizard opens. But if I type some text it will appear in my Text control. But the ModifyListener will not be called.

2) If I set the cursor on my Text control (and it should be the first click after wizard opens) I can see the cursor and I can type some text. But the ModifyListener will not be called.

3) If I open wizard and click somewhere and click after that on my Text field - I can see the cursor, I can type some text and the ModifyListener will be called every time when I change text. It is OK.
Comment 1 Ivan Furnadjiev CLA 2009-07-03 03:43:19 EDT
Hi Igor, this is really strange. Can you provide a snippet/project that demonstrate this behaviour? Is it FF 3.0 or 3.5?
Comment 2 Ivan Furnadjiev CLA 2009-07-03 04:07:56 EDT
BTW I've managed to reproduce more or less what you describe with Workbench Demo -> Import/Export wizard. But a separate snippet/project to reproduce the bug will be welcomed.
Comment 3 Ivan Furnadjiev CLA 2009-07-06 10:36:35 EDT
I've tried to reproduce it with a simple wizard with one page. I've used the Workbench Demo -> DemoExport.java and added a Text with a modify listener attached. setFocus() called in IDialogPage#createControl works in FF 3.5. The modify listener works too. Igor, a snippet is really needed here.
Comment 4 Ivan Furnadjiev CLA 2010-01-12 03:20:41 EST
I will close it as WORKSFORME. Igor, please reopen if the bug persist and you have a snippet to reproduce.