Hi All,
I have a web app, whose UI is written in GWT, where for various reasons I need to resize the active window when the server reports things.
To do this I use a JSNI function which uses resizeTo and everything works great.
I did a small test and tried sending a few updates from the server and got an "Access is denied" error from the resizeTo command.
After googling a bit I discovered that this is because the browser is still busy with another resizeTo command and throws an exception due to that.
My question is if anyone has a good way to see if the browser is ready/available to be resized?
A current workaround I'm thinking, but I don't particularly like, is having a try { } catch()
block and if an exception is thrown then catch it and call the function again in timeout but I would like to have a more straightforward way.
Thanks, Ittai
EDIT: I thought of another problem though, what if update A and update B return together from the server and A starts while B sleeps for X ms, in the mean time update C is sent from the server and finds that A is finished although B hasn't awaken yet so C executes and only then B which is wrong because B does not contain the most recent size. Do you have an idea for a solution? Is that a race condition problem? Thanks