UICallbacks are canceled when pressing ESC in Browser [message #109693] |
Fri, 17 October 2008 11:45  |
Eclipse User |
|
|
|
Hi,
I noticed that (at least in Firefox) the UICallback-Request can be
canceled by the user if he presses ESC having some element outside the
RAP application focussed.
This can be reproduced with the RAP widget demo on the tab ProgressBar.
Simply click on "Start Background Progress" and then click in the
browser's address text and press ESC.
I experimented with adding a Failed-EventListener on the qx-side to get
notified when a UICallbackRequest failed. The idea was to fire the
request again in this case. It didn't work as expected and I am not sure
if this is a good approach.
Any thoughts about that?
Stefan.
|
|
|
|
Re: UICallbacks are canceled when pressing ESC in Browser [message #109906 is a reply to message #109885] |
Mon, 20 October 2008 07:25   |
Eclipse User |
|
|
|
Hi Frank,
I believe that hitting the ESC key by the user doesn't happen by
intention, so the aim is to restore the UICallback request to get it
working again. Do you agree?
What I tried was to start a new request on the client side which (I
hoped) would have been handled by the old thread on the server side. The
problem then is, that the Failedevent-Listener is also called when the
user navigates to another page which probably isn't intended.
My JS error handler in Request.js looked like this:
_handleUICallBackFailed : function ( evt ) {
if( this._isConnectionError( evt.getStatusCode() ) ) {
var failedRequest = evt.getTarget().getRequest();
var failedParameters = failedRequest.getParameters();
for( var parameterName in failedParameters ) {
service_param = parameterName;
service_id = failedParameters[ parameterName ];
}
var url = failedRequest.getUrl();
this.enableUICallBack(url, service_param, service_id )
}
},
Before finding out the reason why this doesn't work as expected
(progress bar didn't continue running) I just wanted to hear other
opinions about this approach...
Regards,
Stefan.
Frank Appel schrieb:
> Hi,
>
> the problem doesn't show up with IE but can easily be reproduced with
> FF. I assume that the request thread could still be locked on the server
> side and should be released. So I agree that a client-side only solution
> may not be the best solution. But one question is how to detect on the
> serverside that the request has been canceled? Or did you try to pass
> the information about the failed request to the server using that
> Failed-EventListener?
>
>
> Ciao
> Frank
>
> -----Ursprüngliche Nachricht-----
> Von: Stefan Roeck [mailto:stefan.roeck@cas.de]
> Bereitgestellt: Freitag, 17. Oktober 2008 17:46
> Bereitgestellt in: eclipse.technology.rap
> Unterhaltung: UICallbacks are canceled when pressing ESC in Browser
> Betreff: UICallbacks are canceled when pressing ESC in Browser
>
> Hi,
>
> I noticed that (at least in Firefox) the UICallback-Request can be
> canceled by the user if he presses ESC having some element outside the
> RAP application focussed.
>
> This can be reproduced with the RAP widget demo on the tab ProgressBar.
> Simply click on "Start Background Progress" and then click in the
> browser's address text and press ESC.
>
> I experimented with adding a Failed-EventListener on the qx-side to get
> notified when a UICallbackRequest failed. The idea was to fire the
> request again in this case. It didn't work as expected and I am not sure
>
> if this is a good approach.
>
> Any thoughts about that?
> Stefan.
>
|
|
|
Re: UICallbacks are canceled when pressing ESC in Browser [message #110050 is a reply to message #109906] |
Tue, 21 October 2008 12:31   |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
I also would not consider hitting the ESC button by the user is done
intentionally - at least if there's no progress dialog. This could be an
attempt to cancel the job...
But considering your approach I remember that there is a serverside
mechanism in the UICallBackManager that blocks only an incomming request
if no other request is already blocked. So if the thread of the aborted
request is still locked on the server side your additional request will
be ignored.
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Stefan Roeck [mailto:stefan.roeck@cas.de]
Bereitgestellt: Montag, 20. Oktober 2008 13:26
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: UICallbacks are canceled when pressing ESC in Browser
Betreff: Re: UICallbacks are canceled when pressing ESC in Browser
Hi Frank,
I believe that hitting the ESC key by the user doesn't happen by
intention, so the aim is to restore the UICallback request to get it
working again. Do you agree?
What I tried was to start a new request on the client side which (I
hoped) would have been handled by the old thread on the server side. The
problem then is, that the Failedevent-Listener is also called when the
user navigates to another page which probably isn't intended.
My JS error handler in Request.js looked like this:
_handleUICallBackFailed : function ( evt ) {
if( this._isConnectionError( evt.getStatusCode() ) ) {
var failedRequest = evt.getTarget().getRequest();
var failedParameters = failedRequest.getParameters();
for( var parameterName in failedParameters ) {
service_param = parameterName;
service_id = failedParameters[ parameterName ];
}
var url = failedRequest.getUrl();
this.enableUICallBack(url, service_param, service_id )
}
},
Before finding out the reason why this doesn't work as expected
(progress bar didn't continue running) I just wanted to hear other
opinions about this approach...
Regards,
Stefan.
Frank Appel schrieb:
> Hi,
>
> the problem doesn't show up with IE but can easily be reproduced with
> FF. I assume that the request thread could still be locked on the
server
> side and should be released. So I agree that a client-side only
solution
> may not be the best solution. But one question is how to detect on the
> serverside that the request has been canceled? Or did you try to pass
> the information about the failed request to the server using that
> Failed-EventListener?
>
>
> Ciao
> Frank
>
> -----Ursprüngliche Nachricht-----
> Von: Stefan Roeck [mailto:stefan.roeck@cas.de]
> Bereitgestellt: Freitag, 17. Oktober 2008 17:46
> Bereitgestellt in: eclipse.technology.rap
> Unterhaltung: UICallbacks are canceled when pressing ESC in Browser
> Betreff: UICallbacks are canceled when pressing ESC in Browser
>
> Hi,
>
> I noticed that (at least in Firefox) the UICallback-Request can be
> canceled by the user if he presses ESC having some element outside the
> RAP application focussed.
>
> This can be reproduced with the RAP widget demo on the tab
ProgressBar.
> Simply click on "Start Background Progress" and then click in the
> browser's address text and press ESC.
>
> I experimented with adding a Failed-EventListener on the qx-side to
get
> notified when a UICallbackRequest failed. The idea was to fire the
> request again in this case. It didn't work as expected and I am not
sure
>
> if this is a good approach.
>
> Any thoughts about that?
> Stefan.
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03413 seconds