Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Focus events not fired from browsers
Focus events not fired from browsers [message #766868] Fri, 16 December 2011 15:17 Go to next message
Enrico Zanaga is currently offline Enrico ZanagaFriend
Messages: 50
Registered: July 2009
Member
Hi,

I run the following snippet in any browser (Firefox, Chrome, Opera,
Safari, IE):
----
public class RapTest implements IEntryPoint {
public int createUI() {
Display d = new Display();
Shell s = new Shell(d, SWT.SHELL_TRIM);
s.setText("Test");
s.setBounds(0, 0, 800, 200);
for( int y = 0; y < 3; y++ )
for( int x = 0; x < 20; x++ ) {
final Text t = new Text(s, SWT.BORDER);
t.setBounds(50 + (x*30), 50 + (y*50), 20, 25);
t.setData("" + y + "." + x);
final Label l = new Label(s, SWT.NONE);
l.setBounds(50 + (x*30), 75 + (y*50), 20, 25);
t.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent event) {
System.out.println("gain: " + t.getData());
}
public void focusLost(FocusEvent event) {
System.out.println("lost: " + t.getData());
}
});
}
s.open();
while( !s.isDisposed() )
if( !d.readAndDispatch() )
d.sleep();
return 0;
}
}
----


Keeping TAB key pressed, log in the console look like this:
----
gain: 0.0
lost: 0.0
gain: 0.1
lost: 0.1
gain: 0.3
lost: 0.3
gain: 0.5
lost: 0.5
gain: 0.7
lost: 0.7
gain: 0.9
lost: 0.9
gain: 0.11
lost: 0.11
gain: 0.13
lost: 0.13
gain: 0.15
lost: 0.15
gain: 0.17
lost: 0.17
gain: 0.19
lost: 0.19
gain: 1.1
lost: 1.1
gain: 1.3
lost: 1.3
gain: 1.5
lost: 1.5
gain: 1.7
lost: 1.7
gain: 1.9
lost: 1.9
gain: 1.11
lost: 1.11
gain: 1.13
lost: 1.13
gain: 1.15
lost: 1.15
gain: 1.17
lost: 1.17
gain: 1.19
lost: 1.19
gain: 2.2
lost: 2.2
gain: 2.4
lost: 2.4
gain: 2.7
lost: 2.7
gain: 2.9
lost: 2.9
gain: 2.11
lost: 2.11
gain: 2.13
lost: 2.13
gain: 2.15
lost: 2.15
gain: 2.17
lost: 2.17
gain: 2.19
lost: 2.19
----


Some focusGained/focusLost events are missing from the log, I'm expecting:
----
gain: 0.0
lost: 0.0
gain: 0.1
lost: 0.1
gain: 0.2
gain: 0.2
lost: 0.3
lost: 0.3
gain: 0.4
lost: 0.4
gain: 0.5
lost: 0.5
gain: 0.6
lost: 0.6
gain: 0.7
lost: 0.7
.....
----


This problem is present in both RAP 1.3 and 1.4.

I use focusLost event to save the Text.getText() value, some of these
values won't be saved when inserted too fast.

Since the behavior is the same in five browsers maybe a RAP/qooxdoo problem?
Please, can you give me a hint where I can modify javascript or java
code so every event is fired from the browser?

I use RAP in production and this problem makes my application inserting
wrong data in the database, so I'm prone to modify and test RAP
libraries to solve! :)

Thanks
Enrico
Re: Focus events not fired from browsers [message #766876 is a reply to message #766868] Fri, 16 December 2011 15:31 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Enrico,
I think that you are running into this bug:
327887: [client] Events are lost while http-request is pending
https://bugs.eclipse.org/bugs/show_bug.cgi?id=327887
Best,
Ivan

On 12/16/2011 5:17 PM, Enrico Zanaga wrote:
> Hi,
>
> I run the following snippet in any browser (Firefox, Chrome, Opera,
> Safari, IE):
> ----
> public class RapTest implements IEntryPoint {
> public int createUI() {
> Display d = new Display();
> Shell s = new Shell(d, SWT.SHELL_TRIM);
> s.setText("Test");
> s.setBounds(0, 0, 800, 200);
> for( int y = 0; y < 3; y++ )
> for( int x = 0; x < 20; x++ ) {
> final Text t = new Text(s, SWT.BORDER);
> t.setBounds(50 + (x*30), 50 + (y*50), 20, 25);
> t.setData("" + y + "." + x);
> final Label l = new Label(s, SWT.NONE);
> l.setBounds(50 + (x*30), 75 + (y*50), 20, 25);
> t.addFocusListener(new FocusAdapter() {
> public void focusGained(FocusEvent event) {
> System.out.println("gain: " + t.getData());
> }
> public void focusLost(FocusEvent event) {
> System.out.println("lost: " + t.getData());
> }
> });
> }
> s.open();
> while( !s.isDisposed() )
> if( !d.readAndDispatch() )
> d.sleep();
> return 0;
> }
> }
> ----
>
>
> Keeping TAB key pressed, log in the console look like this:
> ----
> gain: 0.0
> lost: 0.0
> gain: 0.1
> lost: 0.1
> gain: 0.3
> lost: 0.3
> gain: 0.5
> lost: 0.5
> gain: 0.7
> lost: 0.7
> gain: 0.9
> lost: 0.9
> gain: 0.11
> lost: 0.11
> gain: 0.13
> lost: 0.13
> gain: 0.15
> lost: 0.15
> gain: 0.17
> lost: 0.17
> gain: 0.19
> lost: 0.19
> gain: 1.1
> lost: 1.1
> gain: 1.3
> lost: 1.3
> gain: 1.5
> lost: 1.5
> gain: 1.7
> lost: 1.7
> gain: 1.9
> lost: 1.9
> gain: 1.11
> lost: 1.11
> gain: 1.13
> lost: 1.13
> gain: 1.15
> lost: 1.15
> gain: 1.17
> lost: 1.17
> gain: 1.19
> lost: 1.19
> gain: 2.2
> lost: 2.2
> gain: 2.4
> lost: 2.4
> gain: 2.7
> lost: 2.7
> gain: 2.9
> lost: 2.9
> gain: 2.11
> lost: 2.11
> gain: 2.13
> lost: 2.13
> gain: 2.15
> lost: 2.15
> gain: 2.17
> lost: 2.17
> gain: 2.19
> lost: 2.19
> ----
>
>
> Some focusGained/focusLost events are missing from the log, I'm
> expecting:
> ----
> gain: 0.0
> lost: 0.0
> gain: 0.1
> lost: 0.1
> gain: 0.2
> gain: 0.2
> lost: 0.3
> lost: 0.3
> gain: 0.4
> lost: 0.4
> gain: 0.5
> lost: 0.5
> gain: 0.6
> lost: 0.6
> gain: 0.7
> lost: 0.7
> ....
> ----
>
>
> This problem is present in both RAP 1.3 and 1.4.
>
> I use focusLost event to save the Text.getText() value, some of these
> values won't be saved when inserted too fast.
>
> Since the behavior is the same in five browsers maybe a RAP/qooxdoo
> problem?
> Please, can you give me a hint where I can modify javascript or java
> code so every event is fired from the browser?
>
> I use RAP in production and this problem makes my application
> inserting wrong data in the database, so I'm prone to modify and test
> RAP libraries to solve! :)
>
> Thanks
> Enrico
Re: Focus events not fired from browsers [message #768033 is a reply to message #766876] Mon, 19 December 2011 13:06 Go to previous messageGo to next message
Enrico Zanaga is currently offline Enrico ZanagaFriend
Messages: 50
Registered: July 2009
Member
Hi Ivan,
as a workaround, is it possible to create a "parameters"-queue?

I think to maintain an array of "parameters", so any request from
browser adds a hash-table to the queue.

And then invoking Request._handleCompleted check the queue and, if not
empty, send another request and so on.

Might work?



Il 16/12/2011 16.32, Ivan Furnadjiev ha scritto:
> Hi Enrico,
> I think that you are running into this bug:
> 327887: [client] Events are lost while http-request is pending
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=327887
> Best,
> Ivan
>
> On 12/16/2011 5:17 PM, Enrico Zanaga wrote:
>> Hi,
>>
>> I run the following snippet in any browser (Firefox, Chrome, Opera,
>> Safari, IE):
>> ----
>> public class RapTest implements IEntryPoint {
>> public int createUI() {
>> Display d = new Display();
>> Shell s = new Shell(d, SWT.SHELL_TRIM);
>> s.setText("Test");
>> s.setBounds(0, 0, 800, 200);
>> for( int y = 0; y < 3; y++ )
>> for( int x = 0; x < 20; x++ ) {
>> final Text t = new Text(s, SWT.BORDER);
>> t.setBounds(50 + (x*30), 50 + (y*50), 20, 25);
>> t.setData("" + y + "." + x);
>> final Label l = new Label(s, SWT.NONE);
>> l.setBounds(50 + (x*30), 75 + (y*50), 20, 25);
>> t.addFocusListener(new FocusAdapter() {
>> public void focusGained(FocusEvent event) {
>> System.out.println("gain: " + t.getData());
>> }
>> public void focusLost(FocusEvent event) {
>> System.out.println("lost: " + t.getData());
>> }
>> });
>> }
>> s.open();
>> while( !s.isDisposed() )
>> if( !d.readAndDispatch() )
>> d.sleep();
>> return 0;
>> }
>> }
>> ----
>>
>>
>> Keeping TAB key pressed, log in the console look like this:
>> ----
>> gain: 0.0
>> lost: 0.0
>> gain: 0.1
>> lost: 0.1
>> gain: 0.3
>> lost: 0.3
>> gain: 0.5
>> lost: 0.5
>> gain: 0.7
>> lost: 0.7
>> gain: 0.9
>> lost: 0.9
>> gain: 0.11
>> lost: 0.11
>> gain: 0.13
>> lost: 0.13
>> gain: 0.15
>> lost: 0.15
>> gain: 0.17
>> lost: 0.17
>> gain: 0.19
>> lost: 0.19
>> gain: 1.1
>> lost: 1.1
>> gain: 1.3
>> lost: 1.3
>> gain: 1.5
>> lost: 1.5
>> gain: 1.7
>> lost: 1.7
>> gain: 1.9
>> lost: 1.9
>> gain: 1.11
>> lost: 1.11
>> gain: 1.13
>> lost: 1.13
>> gain: 1.15
>> lost: 1.15
>> gain: 1.17
>> lost: 1.17
>> gain: 1.19
>> lost: 1.19
>> gain: 2.2
>> lost: 2.2
>> gain: 2.4
>> lost: 2.4
>> gain: 2.7
>> lost: 2.7
>> gain: 2.9
>> lost: 2.9
>> gain: 2.11
>> lost: 2.11
>> gain: 2.13
>> lost: 2.13
>> gain: 2.15
>> lost: 2.15
>> gain: 2.17
>> lost: 2.17
>> gain: 2.19
>> lost: 2.19
>> ----
>>
>>
>> Some focusGained/focusLost events are missing from the log, I'm
>> expecting:
>> ----
>> gain: 0.0
>> lost: 0.0
>> gain: 0.1
>> lost: 0.1
>> gain: 0.2
>> gain: 0.2
>> lost: 0.3
>> lost: 0.3
>> gain: 0.4
>> lost: 0.4
>> gain: 0.5
>> lost: 0.5
>> gain: 0.6
>> lost: 0.6
>> gain: 0.7
>> lost: 0.7
>> ....
>> ----
>>
>>
>> This problem is present in both RAP 1.3 and 1.4.
>>
>> I use focusLost event to save the Text.getText() value, some of these
>> values won't be saved when inserted too fast.
>>
>> Since the behavior is the same in five browsers maybe a RAP/qooxdoo
>> problem?
>> Please, can you give me a hint where I can modify javascript or java
>> code so every event is fired from the browser?
>>
>> I use RAP in production and this problem makes my application
>> inserting wrong data in the database, so I'm prone to modify and test
>> RAP libraries to solve! :)
>>
>> Thanks
>> Enrico
Re: Focus events not fired from browsers [message #768199 is a reply to message #768033] Mon, 19 December 2011 18:37 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Enrico,
we have plans to fix this issue in this release cycle, but I can't
promise in which milestone we will do it.
Best,
Ivan

On 12/19/2011 3:06 PM, Enrico Zanaga wrote:
> Hi Ivan,
> as a workaround, is it possible to create a "parameters"-queue?
>
> I think to maintain an array of "parameters", so any request from
> browser adds a hash-table to the queue.
>
> And then invoking Request._handleCompleted check the queue and, if not
> empty, send another request and so on.
>
> Might work?
>
>
>
> Il 16/12/2011 16.32, Ivan Furnadjiev ha scritto:
>> Hi Enrico,
>> I think that you are running into this bug:
>> 327887: [client] Events are lost while http-request is pending
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=327887
>> Best,
>> Ivan
>>
>> On 12/16/2011 5:17 PM, Enrico Zanaga wrote:
>>> Hi,
>>>
>>> I run the following snippet in any browser (Firefox, Chrome, Opera,
>>> Safari, IE):
>>> ----
>>> public class RapTest implements IEntryPoint {
>>> public int createUI() {
>>> Display d = new Display();
>>> Shell s = new Shell(d, SWT.SHELL_TRIM);
>>> s.setText("Test");
>>> s.setBounds(0, 0, 800, 200);
>>> for( int y = 0; y < 3; y++ )
>>> for( int x = 0; x < 20; x++ ) {
>>> final Text t = new Text(s, SWT.BORDER);
>>> t.setBounds(50 + (x*30), 50 + (y*50), 20, 25);
>>> t.setData("" + y + "." + x);
>>> final Label l = new Label(s, SWT.NONE);
>>> l.setBounds(50 + (x*30), 75 + (y*50), 20, 25);
>>> t.addFocusListener(new FocusAdapter() {
>>> public void focusGained(FocusEvent event) {
>>> System.out.println("gain: " + t.getData());
>>> }
>>> public void focusLost(FocusEvent event) {
>>> System.out.println("lost: " + t.getData());
>>> }
>>> });
>>> }
>>> s.open();
>>> while( !s.isDisposed() )
>>> if( !d.readAndDispatch() )
>>> d.sleep();
>>> return 0;
>>> }
>>> }
>>> ----
>>>
>>>
>>> Keeping TAB key pressed, log in the console look like this:
>>> ----
>>> gain: 0.0
>>> lost: 0.0
>>> gain: 0.1
>>> lost: 0.1
>>> gain: 0.3
>>> lost: 0.3
>>> gain: 0.5
>>> lost: 0.5
>>> gain: 0.7
>>> lost: 0.7
>>> gain: 0.9
>>> lost: 0.9
>>> gain: 0.11
>>> lost: 0.11
>>> gain: 0.13
>>> lost: 0.13
>>> gain: 0.15
>>> lost: 0.15
>>> gain: 0.17
>>> lost: 0.17
>>> gain: 0.19
>>> lost: 0.19
>>> gain: 1.1
>>> lost: 1.1
>>> gain: 1.3
>>> lost: 1.3
>>> gain: 1.5
>>> lost: 1.5
>>> gain: 1.7
>>> lost: 1.7
>>> gain: 1.9
>>> lost: 1.9
>>> gain: 1.11
>>> lost: 1.11
>>> gain: 1.13
>>> lost: 1.13
>>> gain: 1.15
>>> lost: 1.15
>>> gain: 1.17
>>> lost: 1.17
>>> gain: 1.19
>>> lost: 1.19
>>> gain: 2.2
>>> lost: 2.2
>>> gain: 2.4
>>> lost: 2.4
>>> gain: 2.7
>>> lost: 2.7
>>> gain: 2.9
>>> lost: 2.9
>>> gain: 2.11
>>> lost: 2.11
>>> gain: 2.13
>>> lost: 2.13
>>> gain: 2.15
>>> lost: 2.15
>>> gain: 2.17
>>> lost: 2.17
>>> gain: 2.19
>>> lost: 2.19
>>> ----
>>>
>>>
>>> Some focusGained/focusLost events are missing from the log, I'm
>>> expecting:
>>> ----
>>> gain: 0.0
>>> lost: 0.0
>>> gain: 0.1
>>> lost: 0.1
>>> gain: 0.2
>>> gain: 0.2
>>> lost: 0.3
>>> lost: 0.3
>>> gain: 0.4
>>> lost: 0.4
>>> gain: 0.5
>>> lost: 0.5
>>> gain: 0.6
>>> lost: 0.6
>>> gain: 0.7
>>> lost: 0.7
>>> ....
>>> ----
>>>
>>>
>>> This problem is present in both RAP 1.3 and 1.4.
>>>
>>> I use focusLost event to save the Text.getText() value, some of these
>>> values won't be saved when inserted too fast.
>>>
>>> Since the behavior is the same in five browsers maybe a RAP/qooxdoo
>>> problem?
>>> Please, can you give me a hint where I can modify javascript or java
>>> code so every event is fired from the browser?
>>>
>>> I use RAP in production and this problem makes my application
>>> inserting wrong data in the database, so I'm prone to modify and test
>>> RAP libraries to solve! :)
>>>
>>> Thanks
>>> Enrico
Previous Topic:Jmeter | RAP
Next Topic:Javascript warning in IE8
Goto Forum:
  


Current Time: Thu Apr 25 01:04:45 GMT 2024

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

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

Back to the top