Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327450 - Numeric/Decimal/DateTextRidget not working with RAP (due to RAP Bug #327439)
Summary: Numeric/Decimal/DateTextRidget not working with RAP (due to RAP Bug #327439)
Status: NEW
Alias: None
Product: Riena
Classification: RT
Component: ridget (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 302893
  Show dependency tree
 
Reported: 2010-10-11 10:19 EDT by Jürgen Becker CLA
Modified: 2011-08-03 14:35 EDT (History)
1 user (show)

See Also:


Attachments
Patch for org.eclipse.riena.ui.ridgets.swt fixes NumericTextRidget to work with RAP (5.20 KB, patch)
2010-10-11 10:19 EDT, Jürgen Becker CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jürgen Becker CLA 2010-10-11 10:19:01 EDT
Created attachment 180600 [details]
Patch for org.eclipse.riena.ui.ridgets.swt fixes NumericTextRidget to work with RAP

The RAP SWT implementation does not send a proper VerifyEvent in case of text input via keyboard. It does not set the VerifyEvent.character field. This prevents the NumericTextRidget and derived classes from working properly.

The attached patch is a workaround which should be removed after the RAP bug is fixed.
Comment 1 Steffen Kriese CLA 2010-10-12 02:40:12 EDT
Patch applied, thanks Jürgen. 
I will keep this Bug open until the RAP bug is fixed and we can remove the workaround.
Comment 2 Jürgen Becker CLA 2010-10-19 08:12:26 EDT
After further testing I found another Problem with the NumericTextRidget. If I enter or delete characters very fast, the order of the characters gets mixed up.
This is caused by RAP JS code: After I entered a character the server response (JS-Code) will update the text widget. The code looks something like this:

var w = wm.findWidgetById( "w472" );
w.setValue( "121,211,221" );
org.eclipse.swt.TextUtil.setSelection( w, 5, 0 );

The setValue(...) call updates the value and moves the cursor in the widge to the end of the new value. The TextUtil.setSelection( w, 5, 0 ) call should correct the cursor position. The problem is, the cursor move is delayed.
from TextUtil.setSelection:
...
qx.client.Timer.once( function() {
          text.setSelectionStart( start );
          text.setSelectionLength( length );
        }, text, 50 );
...

So, we have a time gap where the cursor position is wrong. Ever keystroke during that gap will mix up the value.

I don't know why the delay is kneed. We should ask the RAP team.

I currently have no workaround.
Comment 3 Elias Volanakis CLA 2011-01-25 05:27:12 EST
I think the solution here is to add a simplified implementation for RAP.

The simplified implementation should avoid doing formating / validation / cursor positioning on key-by key basis. Instead we should either be able to handle several aggregated keystrokes (i.e. what RAP does) or format and validate the text widget's contents when the focus is about to leave the widget.

Needs further investigation.

Bumping up to P2 because it´s annoying.
Comment 4 Elias Volanakis CLA 2011-08-03 14:35:08 EDT
Ressigning to default assignee. Not working on Riena right now.
Comment 5 Elias Volanakis CLA 2011-08-03 14:35:16 EDT
Reassigning to default assignee. Not working on Riena right now.