hugoloza / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
0 stars 0 forks source link

Page freezes after code loading failed for presenter proxy #401

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a simple GWTP app with two presenters: main and a second one.
2. Annotate the second presenter with @ProxyCodeSplit.
3. Create a button which navigate from the main presenter to the second one.
4. Build the application and deploy (I have used Tomcat).
5. Start the application to load only main presenter (don't navigate yet).
6. Stop the application - don't close the web browser.
7. Make some change in code of second presenter - for example and new a new 
private field.
8. Compile and deploy.
9. Start the application and navigate.

What is the expected output? What do you see instead?
Alert window with message "calculator presenter code load failed". After click 
the window should be gone and the user can click the button again and should 
see the window again.
INSTEAD: Alert window with message "calculator presenter code load failed". 
After click the window is gone but the UI isn't clickable any more. The button 
can't be clicked again. The all UI freezes.

What version of the product are you using? On what operating system?
gwtp-0.6
Window XP Professional SP 3.

Please provide any additional information below.
The second presenter must implement AsyncCallFailHandler and method like below:
    @ProxyEvent
    public void onAsyncCallFail(AsyncCallFailEvent asyncCallFailEvent) {
       Window.alert("calculator presenter code load failed");
    }

Original issue reported on code.google.com by sberga...@googlemail.com on 10 Feb 2012 at 2:35

GoogleCodeExporter commented 9 years ago
I found why the UI is blocked. This is because when a presenter is being loaded 
a transparent DIV is being created so a user can't click anything. If a proxy 
presenter can't be loaded the onFailure method is invoked but the created DIV 
isn't removed.

I attached two screenshots: 
"beforce click": initially loaded page. After click on "Show info" button the 
proxy presenter should be loaded.
"after click": shows that the proxy presenter couldn't be found and that there 
is a transparent DIV with z-index 214... After I had removed the DIV from the 
DOM I could click the UI again.

Is it a bug that the DIV hasn't been removed?

One more thing: the "Show info" button can't be clicked again: I can click it 
but nothing is being invoked. The "Calculate sum" button can be invoked.

Original comment by sberga...@googlemail.com on 14 Feb 2012 at 12:51

Attachments:

GoogleCodeExporter commented 9 years ago
I think I have found the problem in GWTP Framework and provide a solution for 
it.

In my code in presenter when the "Show info" button is clicked, I'm invoking 
the method PlaceManagerImpl.revealPlace(PlaceRequest). This leads to lock the 
screen by invoking the getLock() method in line 328. The interaction should be 
locked for the time when a proxy presenter is loaded. Next a protected method 
doRevealPlace(PlaceRequest, boolean) is invoked. The PlaceRequestInternalEvent 
is fired. In ProxyPlaceAbstract in method bind(PlaceManager, EventBus) an event 
handler is implemented to react to this event. A method handleRequest is 
invoked. As the first step of this method a presenter is loaded. When found 
then success method is invoked and the screen is unlocked in the method 
manualReveal(Presetner<?, ?>) - call placeManager.unlock(). If presenter can't 
be loaded then nothing is happened. and the screen is sitll locked. In this 
case the failure(Throwable) method could be overriden and call 
placeManager.unlock() could be made.

I have attached a patch.

Original comment by sberga...@googlemail.com on 15 Feb 2012 at 10:02

Attachments: