Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Order of events depends on speed of clicking
Order of events depends on speed of clicking [message #1695872] Tue, 19 May 2015 23:11 Go to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
I have a TableViewer.
The TableViewer has a MenuManager.
The MenuManager is set to remove all when shown and has a MenuListener.

The MenuListener adds a set of Action's to the MenuManager when fired, but only if those actions are Enabled.

The actions are SelectionProviderAction's, with the SelectionProvider being the TableViewer.

First Scenario:
When a user right clicks the table, the Selection event and MouseDown even are sent.

This triggers the selection change and the Action's are enabled based on the current selection.

When they release the right mouse button, the MouseUp event is sent and this triggers the menu to show. All is good, only enabled actions are added to the MenuManager.

Second Scenario:
If the user right clicks the table very fast, the Selection even, MouseDown and MouseUp are all sent in the same request.

The Menu is shown first, then the selection event is triggered.



Example of first scenario:
URL Protocol Method Result Type Received Taken Initiator Wait‎‎ Start‎‎ Request‎‎ Response‎‎ Cache read‎‎ Gap‎‎
/sb?cid=a5572753 HTTP POST 200 application/json 364 B 63 ms XMLHttpRequest 10484 16 0 47 0 388390
{"head":{"requestCounter":20},"operations":[["notify","w1070","FocusIn",{}],["set","w7",{"activeControl":"w1070"}],["set","w1070",{"selection":["w1250"]}],["notify","w1070","Selection",{"item":"w1250","button":3,"shiftKey":false,"ctrlKey":false,"altKey":false}],["set","w1070",{"focusItem":"w1250"}],["notify","w1070","MouseDown",{"x":358,"y":288,"time":229049,"button":3,"shiftKey":false,"ctrlKey":false,"altKey":false}],["set","w1",{"cursorLocation":[358,288],"focusControl":"w1070"}]]}

/sb?cid=a5572753 HTTP POST 200 application/json 0.73 KB 31 ms XMLHttpRequest 10594 0 0 31 0 388312
{"head":{"requestCounter":21},"operations":[["notify","w1074","Show",{}],["notify","w1070","MouseUp",{"x":358,"y":288,"time":229125,"button":3,"shiftKey":false,"ctrlKey":false,"altKey":false}],["call","w1070","renderToolTipText",{"item":"w1250","column":0}],["set","w1",{"cursorLocation":[358,288]}]]}


Example of second scenario:
URL Protocol Method Result Type Received Taken Initiator Wait‎‎ Start‎‎ Request‎‎ Response‎‎ Cache read‎‎ Gap‎‎
/sb?cid=a5572753 HTTP POST 200 application/json 0.71 KB 31 ms XMLHttpRequest 38047 0 0 31 0 480844
{"head":{"requestCounter":22},"operations":[["set","w1070",{"selection":["w1258"]}],["notify","w1070","Selection",{"item":"w1258","button":3,"shiftKey":false,"ctrlKey":false,"altKey":false}],["set","w1070",{"focusItem":"w1258"}],["notify","w1070","MouseDown",{"x":336,"y":350,"time":256566,"button":3,"shiftKey":false,"ctrlKey":false,"altKey":false}],["notify","w1074","Hide",{}],["notify","w1074","Show",{}],["notify","w1070","MouseUp",{"x":336,"y":350,"time":256580,"button":3,"shiftKey":false,"ctrlKey":false,"altKey":false}],["set","w1",{"cursorLocation":[336,350]}]]}


I thought RAP ensured the order of events would be consistent?
I'm using RAP 2.3.1
The bundle-version of org.eclipse.rap.rwt is 2.3.1.20140909-1638

The 5 defects fixed in 2.3.2 don't seem to be related.
Re: Order of events depends on speed of clicking [message #1696011 is a reply to message #1695872] Thu, 21 May 2015 07:06 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Chris,
if event is generated on the client, when a request is pending it will
be sent with the next request. RAP send request not often than 60ms. In
some cases (fast/slow clicks) is possible mouse down to be sent with one
request, mouse up with the next. More over the events are not process on
the server in the order they occur on the client - see [1]. We want to
change this, but it's too late for 3.0 release. It requires a huge
internal change in the RAP request processing mechanism - replace life
cycle phases with something else.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=397590
Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Text widget vertical alignment changes since 3.0 M7
Next Topic:[ANN] RAP 3.0 RC1 available
Goto Forum:
  


Current Time: Tue Mar 19 02:15:32 GMT 2024

Powered by FUDForum. Page generated in 0.02038 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top