Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Timing problems with BrowserFunctions
Timing problems with BrowserFunctions [message #543409] Tue, 29 June 2010 10:32 Go to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi,

currently I am experimenting with BrowserFunctions in our project and I
experience some strange timing issues with the function injection.

The problem is, when calling a BrowserFunction very early in the
lifecycle of the document of the browser, say for example, window.onload
calls a BrowserFunction, the function has not necessarily already been
injected, due to the waiting for the loaded window in
Browser.createFunction .

I already tried to register the actual function-registering as an
eventListener on the IFrame-load-event, but there still occurs the race
condition with window.onload of the document in the iframe. My guess is,
that Qooxdoo uses the same waiting-loop as Browser.createFunction to
fire the load-Event.

Are there any hints on how this problem can be resolved?
I think, the most pragmatic solution would be to wait in the
browser-document for all required BrowserFunctions to be registered, but
I kind of do not like this solution to always have to update a
BrowserFunction-registry.

Maybe it would be possible to have the Browser trigger a kind of
ready-Event into the iframe, when all functions are registered. Any
thoughts on how this would be possible?

Since I need a solution for the problem today, I'll probably will go
with one of the possible solutions above and will update this group on
how the final solution looks.
Still, additional hints would be very appreciated.

Regards,
Philipp
Re: Timing problems with BrowserFunctions [message #544247 is a reply to message #543409] Fri, 02 July 2010 06:45 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Philipp,

I'm curious... Did you find a way to solve these timing issues? Can you
share with us your findings?

Best,
Ivan

On 06/29/2010 1:32 PM, Philipp Leusmann wrote:
> Hi,
>
> currently I am experimenting with BrowserFunctions in our project and
> I experience some strange timing issues with the function injection.
>
> The problem is, when calling a BrowserFunction very early in the
> lifecycle of the document of the browser, say for example,
> window.onload calls a BrowserFunction, the function has not
> necessarily already been injected, due to the waiting for the loaded
> window in Browser.createFunction .
>
> I already tried to register the actual function-registering as an
> eventListener on the IFrame-load-event, but there still occurs the
> race condition with window.onload of the document in the iframe. My
> guess is, that Qooxdoo uses the same waiting-loop as
> Browser.createFunction to fire the load-Event.
>
> Are there any hints on how this problem can be resolved?
> I think, the most pragmatic solution would be to wait in the
> browser-document for all required BrowserFunctions to be registered,
> but I kind of do not like this solution to always have to update a
> BrowserFunction-registry.
>
> Maybe it would be possible to have the Browser trigger a kind of
> ready-Event into the iframe, when all functions are registered. Any
> thoughts on how this would be possible?
>
> Since I need a solution for the problem today, I'll probably will go
> with one of the possible solutions above and will update this group on
> how the final solution looks.
> Still, additional hints would be very appreciated.
>
> Regards,
> Philipp
>
Re: Timing problems with BrowserFunctions [message #544957 is a reply to message #544247] Tue, 06 July 2010 08:35 Go to previous messageGo to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi Ivan,

I went with the function-registration method described: I put the names
of all needed functions into an array and then in the window.onload,
loop until all functions are found (or until some timeout occurs) and
then run the actual onload-code.

This is obviously quite a hack and I hope i will find some time to add
an issue to bugzilla with some demo-code during the next few days.
This baby should be quite easy to reproduce.

Regards,
Philipp

Am 02.07.2010 08:45, schrieb Ivan Furnadjiev:
> Hi Philipp,
>
> I'm curious... Did you find a way to solve these timing issues? Can you
> share with us your findings?
>
> Best,
> Ivan
>
> On 06/29/2010 1:32 PM, Philipp Leusmann wrote:
>> Hi,
>>
>> currently I am experimenting with BrowserFunctions in our project and
>> I experience some strange timing issues with the function injection.
>>
>> The problem is, when calling a BrowserFunction very early in the
>> lifecycle of the document of the browser, say for example,
>> window.onload calls a BrowserFunction, the function has not
>> necessarily already been injected, due to the waiting for the loaded
>> window in Browser.createFunction .
>>
>> I already tried to register the actual function-registering as an
>> eventListener on the IFrame-load-event, but there still occurs the
>> race condition with window.onload of the document in the iframe. My
>> guess is, that Qooxdoo uses the same waiting-loop as
>> Browser.createFunction to fire the load-Event.
>>
>> Are there any hints on how this problem can be resolved?
>> I think, the most pragmatic solution would be to wait in the
>> browser-document for all required BrowserFunctions to be registered,
>> but I kind of do not like this solution to always have to update a
>> BrowserFunction-registry.
>>
>> Maybe it would be possible to have the Browser trigger a kind of
>> ready-Event into the iframe, when all functions are registered. Any
>> thoughts on how this would be possible?
>>
>> Since I need a solution for the problem today, I'll probably will go
>> with one of the possible solutions above and will update this group on
>> how the final solution looks.
>> Still, additional hints would be very appreciated.
>>
>> Regards,
>> Philipp
>>
Re: Timing problems with BrowserFunctions [message #546975 is a reply to message #543409] Wed, 14 July 2010 19:27 Go to previous messageGo to next message
ttest  is currently offline ttest Friend
Messages: 4
Registered: July 2009
Junior Member
Hello,

I'm experiencing similar problems with the BrowserFunctions, unfortunately I also can't think of a better solution. I guess I will also go for the solution you suggested.

I'm using the Browser with SWT.MOZILLA, due to that an alternative might be to directly use XPCOM to have more control of the timing behaviour, but this is not something I'm keen to look at rigth now.

Also something else I tried was using a Browser ProgressListener, I tried to call my initialization javascript function from there with Browser.execute, but the ProgressListener.completed is being called too earlier, in my case I'm using the Google Maps API and it is not available at the time the ProgressListener.completed is called.

Best regards,

ttest
Re: Timing problems with BrowserFunctions [message #1696461 is a reply to message #546975] Tue, 26 May 2015 14:49 Go to previous message
Michael Fritscher is currently offline Michael FritscherFriend
Messages: 43
Registered: September 2012
Member
Are there any news about this issue?
Previous Topic:Load balancing with Apache mod_proxy
Next Topic:[ANN] New Visualization Widgets in the RAP Incubator
Goto Forum:
  


Current Time: Wed Dec 01 20:52:39 GMT 2021

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

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

Back to the top