Skip to main content



      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 12:05
Eclipse UserFriend
Hello,

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.

Thanks.

[Updated on: Wed, 05 February 2020 12:07] by Moderator

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


Current Time: Sun Jun 15 04:59:09 EDT 2025

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

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

Back to the top