Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360063 - [Text] selectAll() does not work in some cases
Summary: [Text] selectAll() does not work in some cases
Status: RESOLVED WONTFIX
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-06 02:11 EDT by Alex Mising name CLA
Modified: 2013-10-22 03:37 EDT (History)
1 user (show)

See Also:


Attachments
Two small project to reproduce the bug (635.64 KB, application/zip)
2011-10-06 02:12 EDT, Alex Mising name CLA
no flags Details
Small Project for test with nigthly build (636.21 KB, application/zip)
2011-10-18 08:12 EDT, Alex Mising name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Mising name CLA 2011-10-06 02:11:08 EDT
Build Identifier: 20110301-1815

Hallo to all,

we have a problem with textfield. A the textfield is an "FocusListener". 
It works in RCP right but not in RAP. When you change the text field with the tab it work correct in RCP an RAP (marked the text). I you click in the text it works in RCP and don’t markt the text. In RAP works different. You click slow in the field, it function sometime. If you click fast it don't function ever.

The Text with label a create in the package "util".

Eclipse: 3.6 64bit
RAP 1.4

Thanks
Alexander


Reproducible: Always
Comment 1 Alex Mising name CLA 2011-10-06 02:12:57 EDT
Created attachment 204650 [details]
Two small project to reproduce the bug

Two small project to reproduce the bug.

The Text with label a create in the package "util".
Comment 2 Ivan Furnadjiev CLA 2011-10-06 03:54:22 EDT
Alex, I can reproduce the issue with your test project and RAP from CVS HEAD.
Comment 3 Ivan Furnadjiev CLA 2011-10-06 04:21:46 EDT
The problem is the following. The focused control (FocusEvent) is send from client-to-server on client mousedown event. With the same mousedown event the selection is changed to empty, but this new selection (selection start and length) is added to the request parameters in *mouseup* event (TextUtil.js). Thus, when there is a big delay between mousedown and mouseup event on the client, the FocusEvent on the server is fired on the old selection. If old selection is still the complete text, due to preserve mechanism, it is not rendered back to the client.
Comment 4 Ivan Furnadjiev CLA 2011-10-06 05:50:44 EDT
Fixed by adding the changed selection (start, length) request parameter in mousedown too (TextUtil.js). Changes are in CVS HEAD.
Comment 5 Alex Mising name CLA 2011-10-13 07:01:10 EDT
Hallo,

I have tested with the current nightly build. 
You can reproduce it with the same added project. The different is when you click in the text it marked ever (by slow and fast). 
I wont to click with mouse in the text field, the text don’t marked. 

Thanks
Alexander
Comment 6 Ivan Furnadjiev CLA 2011-10-15 12:41:06 EDT
Alex, which browser are you using? Is the problem persist in all browsers - IE, Firefox, Chrome, Safari and Opera?
Comment 7 Alex Mising name CLA 2011-10-18 01:52:22 EDT
(In reply to comment #6)
> Alex, which browser are you using? Is the problem persist in all browsers - IE,
> Firefox, Chrome, Safari and Opera?

Hallo Ivan,
Sorry that I answer yet. I was some day in holiday.
We used Firefox but is in all browsers.
Comment 8 Ivan Furnadjiev CLA 2011-10-18 05:13:59 EDT
Hi Alex, I can't reproduce it anymore. Tested with all browsers and current CVS HEAD. Are you sure that you are using the nightly runtime build from:
repo: http://download.eclipse.org/rt/rap/nightly/runtime/
zip: https://hudson.eclipse.org/hudson/job/rap-runtime/lastStableBuild/
Comment 9 Alex Mising name CLA 2011-10-18 07:44:21 EDT
Hi Ivan,
i used the current nightly build. The function „selectAll()“ works.

My bug was: I wont to click with mouse in the text field. The text don’t marked if i used “FocusListener” with „selectAll()“.
Comment 10 Ivan Furnadjiev CLA 2011-10-18 07:54:04 EDT
Hi Alex, I understand your problem and it was reproducible for me before the fix. Unfortunately, I can't reproduce it anymore with your RAP test project and CVS HEAD. Click with a mouse inside a Text, triggers FocusListener that calls sellectAll - this works for me in all browsers.
Comment 11 Alex Mising name CLA 2011-10-18 08:12:18 EDT
Created attachment 205418 [details]
Small Project for test with nigthly build

Added small Project it was modify for RAP 1.5
Comment 12 Alex Mising name CLA 2011-10-18 08:13:22 EDT
I Added a the small Project where the start is modify for RAP 1.5
Comment 13 Ivan Furnadjiev CLA 2011-10-18 08:23:50 EDT
Alex.... still works for me. Please do the following: Run your snippet inside Eclipse and type "ss" command in the osgi console. Please post here the bundles list.
Comment 14 Alex Mising name CLA 2011-10-18 08:29:35 EDT
Framework is launched.

id	State       Bundle
0	ACTIVE      org.eclipse.osgi_3.8.0.v20110908-1857
	            Fragments=33
1	ACTIVE      org.mortbay.jetty.server_6.1.23.v201012071420
2	ACTIVE      org.eclipse.equinox.preferences_3.4.100.v20110823-1251
3	RESOLVED    org.eclipse.core.databinding.property.nl_de_3.6.0.v20100814043401
	            Master=14
4	ACTIVE      org.eclipse.equinox.http.jetty_2.0.100.v20110502
5	ACTIVE      com.ibm.icu.base_4.4.2.v20110831
6	ACTIVE      org.eclipse.rap.jface_1.5.0.20111018-0113
	            Fragments=19
7	ACTIVE      org.eclipse.equinox.http.servlet_1.1.300.v20110829-1633
8	ACTIVE      org.eclipse.osgi.services_3.3.0.v20110711-1243
9	ACTIVE      org.eclipse.rap.design.example_1.5.0.20111018-0113
10	ACTIVE      RAP_Test_1.0.0.qualifier
11	RESOLVED    org.eclipse.rap.ui.workbench.nl_de_3.6.0.v20100814043401
	            Master=35
12	ACTIVE      org.eclipse.core.expressions_3.4.300.v20110228
13	ACTIVE      org.eclipse.rap.demo_1.5.0.20111018-0113
14	ACTIVE      org.eclipse.core.databinding.property_1.4.0.I20110222-0800
	            Fragments=3
15	ACTIVE      org.eclipse.core.databinding.beans_1.2.100.I20100824-0800
	            Fragments=30
16	ACTIVE      org.mortbay.jetty.util_6.1.23.v201012071420
17	ACTIVE      org.eclipse.rap.demo.databinding_1.5.0.20111018-0113
18	ACTIVE      org.eclipse.rap.rwt_1.5.0.20111018-0113
	            Fragments=21
19	RESOLVED    org.eclipse.rap.jface.nl_de_3.6.0.v20100814043401
	            Master=6
20	RESOLVED    org.eclipse.core.databinding.nl_de_3.6.0.v20100814043401
	            Master=37
21	RESOLVED    org.eclipse.rap.rwt.nl_de_3.6.0.v20100814043401
	            Master=18
22	RESOLVED    org.eclipse.rap.ui.nl_de_3.6.0.v20100814043401
	            Master=32
23	ACTIVE      org.eclipse.core.commands_3.6.0.I20110111-0800
24	ACTIVE      org.eclipse.rap.jface.databinding_1.5.0.20111018-0113
	            Fragments=45
25	ACTIVE      org.eclipse.rap.ui.forms_1.5.0.20111018-0113
	            Fragments=29
26	RESOLVED    org.eclipse.core.databinding.observable.nl_de_3.6.0.v20100814043401
	            Master=42
27	ACTIVE      org.eclipse.rap.rwt.osgi_1.5.0.20111018-0113
28	ACTIVE      org.eclipse.equinox.registry_3.5.200.v20110815-1601
29	RESOLVED    org.eclipse.rap.ui.forms.nl_de_3.6.0.v20100814043401
	            Master=25
30	RESOLVED    org.eclipse.core.databinding.beans.nl_de_3.6.0.v20100814043401
	            Master=15
31	ACTIVE      javax.servlet_2.5.0.v201103041518
32	ACTIVE      org.eclipse.rap.ui_1.5.0.20111018-0113
	            Fragments=22
33	RESOLVED    org.eclipse.equinox.servletbridge.extensionbundle_1.2.0.v20100503
	            Master=0
34	RESOLVED    org.eclipse.rap.ui.views.nl_de_3.6.0.v20100814043401
	            Master=44
35	ACTIVE      org.eclipse.rap.ui.workbench_1.5.0.20111018-0113
	            Fragments=11
36	ACTIVE      org.eclipse.core.runtime_3.7.0.v20110912-1510
37	ACTIVE      org.eclipse.core.databinding_1.4.0.I20110111-0800
	            Fragments=20
38	ACTIVE      org.eclipse.help_3.5.100.v20110426
39	ACTIVE      org.eclipse.core.jobs_3.5.200.v20110721-1714
40	ACTIVE      org.eclipse.equinox.common_3.6.0.v20110523
41	ACTIVE      org.eclipse.equinox.app_1.3.100.v20110321
42	ACTIVE      org.eclipse.core.databinding.observable_1.4.0.I20110222-0800
	            Fragments=26
43	ACTIVE      org.eclipse.core.contenttype_3.4.100.v20110423-0524
44	ACTIVE      org.eclipse.rap.ui.views_1.5.0.20111018-0113
	            Fragments=34
45	RESOLVED    org.eclipse.rap.jface.databinding.nl_de_3.6.0.v20100814043401
	            Master=24
46	ACTIVE      org.eclipse.equinox.http.registry_1.1.100.v20110502
Comment 15 Ivan Furnadjiev CLA 2011-10-18 08:50:24 EDT
Everything looks good. Could you try to guide me step-by-step where to click in order to reproduce it?
Comment 16 Alex Mising name CLA 2011-10-19 03:08:18 EDT
The current situation with the nightly build (RAP) and the "FocusListener" (with selectAll()) is: 
  Text field one
  Switch with "tap" to next text field (with text)
    The text is marked

  Text field one
  Switch with "mouse" to next text field (with text)
    The text is marked


The attitude in RCP and the "FocusListener" (with selectAll()) is:
  Text field one
  Switch text field to other with "tap"
    Text marked

  Text field one
  Switch with "mouse" to next text field (with text)
    The text is –don’t-- marked

This is what i won’t.
Comment 17 Ivan Furnadjiev CLA 2011-10-19 03:24:45 EDT
(In reply to comment #16)
Alex, form your explanation RAP behaves correctly, isn't it (please confirm)? If you have problems with RCP (SWT) please open a bug against Platform.
Comment 18 Alex Mising name CLA 2011-10-19 04:11:26 EDT
(In reply to comment #17)
> (In reply to comment #16)
> Alex, form your explanation RAP behaves correctly, isn't it (please confirm)?
> If you have problems with RCP (SWT) please open a bug against Platform.

Ivan,
do you mean update the head discription and title?
In RCP it works OK.
Comment 19 Ivan Furnadjiev CLA 2011-10-19 04:31:45 EDT
Alex, in comment #16 you say that:
> The attitude in RCP and the "FocusListener" (with selectAll()) is:
> Text field one
> Switch text field to other with "tap"
> Text marked

> Text field one
> Switch with "mouse" to next text field (with text)
> The text is –don’t— marked

> This is what i won’t.
which means that RCP does not behave correct - text is not selected if you call selectAll in focusGain.
In comment #18 you said that:
> In RCP it works OK.
These are two opposite statements. Does RAP behave correctly - yes or no?
Comment 20 Alex Mising name CLA 2011-10-19 05:24:33 EDT
Ivan, in Comment 19 you said that:
> which means that RCP does not behave correct - text is not selected if you call
> selectAll in focusGain
RCP works correct. The text doesn’t mark if go in with MOUSE.

In Comment 19 you said that:
> These are two opposite statements. Does RAP behave correctly - yes or no?
For my, no.
Comment 21 Ivan Furnadjiev CLA 2011-10-19 05:58:48 EDT
Now I understand - the text should *not* be selected, when you focus the Text widget by mouse even the selectAll is called in focusedGain. But I don't think that this is a correct behavior (even if it works in RCP). From my POV selectAll in focusedGain event should select the text regardless how the Text is focused (mouse or TAB). We should check how it behaves in GTK.
Comment 22 Ivan Furnadjiev CLA 2013-10-22 03:37:17 EDT
I'm still thinking that selectAll in focusedGain event should select the text regardless how the Text is focused. Will close it as WONTFIX.