Bug 285956 - [Text] Programmatic selection of text does not work
Summary: [Text] Programmatic selection of text does not work
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.2   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 1.3 M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2009-08-06 22:02 EDT by Tim Whittington CLA
Modified: 2009-09-15 18:29 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Whittington CLA 2009-08-06 22:02:12 EDT
Build ID: 1.2

Steps To Reproduce:
1. Create a Text control
2. Set some text in the control
3. Call selectAll() on the Text control


More information:
The rendered Text control does not have the text selected.

Selecting the text programatically after the Text control is displayed (i.e. on a Button push) does not work either.
Comment 1 Tim Whittington CLA 2009-08-06 22:05:18 EDT
Debugging through TextLCA, I can see the selection being written in renderChanges, so I'm guessing this is a client side bug.
Comment 2 Ivan Furnadjiev CLA 2009-08-12 06:51:52 EDT
I can't reproduce it with FF 3.5.2, IE8, Chrome on Windows Vista with Controls Demo -> Text Tab, CVS HEAD. There are other bugs Bug 236577 and Bug 243876 related to the text selection that you can run on them.
Comment 3 Tim Whittington CLA 2009-08-13 17:14:21 EDT
It seems this is a bit more random than I thought...

Selection works on:
* OS X - Chrome 3.0.198.1 (pre release)
* OS X - Safari 3.0.4

Selection does not work on:
* OS X - Firefox 3.0
* OS X - Firefox 3.5.2
* OS X - Safari 4.0.3
* Windows XP - Firefox 3.1 b2
* Windows XP - IE 8

I'm testing with a basic Shell with a single control in it, so there shouldn't be any undue interactions.
Comment 4 Ivan Furnadjiev CLA 2009-09-14 04:09:06 EDT
Hi Tom, with fixing the Bug 236577 this isuue should be fixed too. Please note that a call to text.setFocus() is needed to visualize the selection (see snippet on bug 236577). Please confirm that the issue is fixed on OS X.
Comment 5 Tim Whittington CLA 2009-09-14 22:06:14 EDT
This still isn't working in CVS HEAD.

I've tested with IE 7 + 8 on XP, FF 3.5.3 on OS X, XP and Linux, FF 3.0.10 and 3.0.14 on OS X, Safari 3.0.4 and 4.0.3 on OS X and Chrome 4.0.207 on OS X.

As before, only Safari 3.0.4 and Chrome 4.0.207 work as expected.

In our case the selection failing is in org.eclipse.jface.dialogs.InputDialog, which does indeed execute setFocus() and selectAll().

Adding a selectAll() and setFocus() to the test snippet in Bug 236577 also fails to work (the text selection from the button press works, but not on load).
Comment 6 Ivan Furnadjiev CLA 2009-09-15 03:34:40 EDT
On load selection is fixed in CVS HEAD too. Please reopen if the bug persist.
Comment 7 Tim Whittington CLA 2009-09-15 18:29:15 EDT
Tested on all the browsers listed previously, and works on all of them. 
Thanks for the fix!