Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Text setSelection not updating correctly on mouse up event(Client side remote objects event handling)
Text setSelection not updating correctly on mouse up event [message #1821110] Wed, 05 February 2020 17:05
Xi Jin is currently offline Xi JinFriend
Messages: 5
Registered: May 2018
Junior Member

We have a client side remote object and we are attaching event handler to a text control on mouseUp event. However, the setSelection() on the text widget doesn't seem to be updating the selection based on the cursor placement. We need to set the selection from the current cursor position to the end of the text.

It seems to work fine and updates the selection when we move the cursor to the left of the current position but doesn't update when we move the cursor to the right of the current position. Logging out widget.getSelection()[0] doesn't seem to give the right value. This seems to work fine in SWT/RCP with widget.getSelection().x.

Here is the code which we have on the client side JS:

onMouseUp(event) {
    const widget = event.widget;
    widget.setSelection([widget.getSelection()[0], widget.getText().length]);

We have also tried giving a using the timeout function to trigger it later but that suffers from the same problem:
setTimeout(function() {
    widget.setSelection([widget.getSelection()[0], widget.getText().length]);
   }, 0);

Any suggestions/recommendations would be appreciated.


[Updated on: Wed, 05 February 2020 17:07]

Report message to a moderator

Previous Topic:RAP e4 demo pbs with icons.....
Next Topic:WAR Deployment: How to?
Goto Forum:

Current Time: Sun Jul 14 14:57:35 GMT 2024

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

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

Back to the top