neo09 / gwt-platform

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

Issue when call my MyMainPage.setContent() to extend PresenterWidgetImpl: Message Error: 22:18:12.992 [ERROR] [testgwtplatform] Uncaught exception escaped java.lang.AssertionError: Internal error, PlaceRequest passed to updateHistory doesn't match the tail of the place hierarchy. #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Hello, I recently developed in GWTP and I'm doing proof of concept. I have a 
DockLayoutPanel in the North that has a button that make you click a button on 
the burden of DockPanel Center. So here is working properly now when I want to 
do that by pressing the center button and delete the button and return to the 
North button gives an error: 

""" Message Error: 22:18:12.992 [ERROR] [testgwtplatform] Uncaught exception 
escaped java.lang.AssertionError: Internal error, PlaceRequest passed to 
updateHistory doesn't match the tail of the place hierarchy. """

1.First, click to button (inside to Norte in DockLayoutPanel) in the MainView 
and execute event to MainPresenter "onClick()" 

public class MainPresenter  extends PresenterImpl<MainPresenter.MyView, 
MainPresenter.MyProxy> {

... 

@ContentSlot
    public static final Type<RevealContentHandler<?>> TYPE_SetMainContent = new Type<RevealContentHandler<?>>();

@Override
protected void onBind() {
        public void onClick(ClickEvent event) {
            PlaceRequest myRequest = new PlaceRequest("!formAltaUsuario");
        placeManager.revealPlace( myRequest );
        }
...

}

2.Second, click to button "Aceptar" (the button inside to center panel)

class FormAltaUsuarioPresenter extends 
PresenterImpl<FormAltaUsuarioPresenter.MyView, 

...

FormAltaUsuarioPresenter.MyProxy> {
    public interface MyView extends View {
    }

    @Override
    revealInParent() {
RevealContentEvent.fire(eventBus,                                          
MainPresenter.TYPE_SetMainContent, this);

    }
....
}

public class MainView extends ViewImpl implements MyView {

        ....

    @Override
    public HasClickHandlers formUsuarioAltaClick() {
        return this.registrar;
    }

    @Override
    public void setContent(Object slot, Widget content) {
        if (slot == MainPresenter.TYPE_SetMainContent) {
            setMainContent(content);
        } else {
            super.setContent(slot, content);
        }
    }
....

}

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
GWTP 0.3 

Please provide any additional information below.

Original issue reported on code.google.com by jero.car...@gmail.com on 9 Jun 2010 at 2:03

GoogleCodeExporter commented 9 years ago
I ran into this problem when reavealing places through the old mechanism of 
firing a PlaceRequestEvent. You should now use placeManager.revealPlace()
This is documented in:
http://code.google.com/p/gwt-platform/wiki/PortingV1#Do_not_reveal_presenters_th
rough_their_proxy_or_by_firing_a_Plac

I'm guessing this will be an issue for many people porting from V0.2, V0.3. As 
such, I will rename PlaceRequestEvent to PlaceRequestEventInternal and will 
make sure the javascript documentation is adequate. I will close this issue 
then.

Original comment by philippe.beaudoin on 15 Jun 2010 at 5:21

GoogleCodeExporter commented 9 years ago

Original comment by philippe.beaudoin on 15 Jun 2010 at 5:21

GoogleCodeExporter commented 9 years ago
Hi Philippe,

i ran into this problem. 

What I still don't understand:
Where, in the example above, the PlaceRequestEvent event is called or where the 
old mechanism is used which causes the error?

placeManager.revealPlace(new PlaceRequest(NameTokens.packageLoadPage));
In my case, the content updated exactly as I want it, but the URL still 
displays the defaultPlace token and the error message above occurs in the log.

Maybe you can explain this mechanism in more detail?

Original comment by FloOn...@gmail.com on 18 Jun 2010 at 3:28

GoogleCodeExporter commented 9 years ago
With the new mechanism, the PlaceManager maintains a place hierarchy: a list of 
all the places found in the history token. This makes it possible to refer to 
the place's parent, for example.

The PlaceRequestEvent, on the other hand, is used by the PlaceManager to 
communicate with the Proxy that needs to answer the request. It is an internal 
event. If you fire it directly, you bypass the PlaceManager and its state gets 
out-of-sync.

The reason it was fine before was because the PlaceManager was mostly stateless 
(Well, not totally, but the problems were minor. It only meant you skipped 
navigation confirmation). Now, however, it causes problems because it means the 
place hierarchy will not be updated.

As of now, the PlaceRequestEvent has been renamed to PlaceRequestInternalEvent 
and it was made package-protected. You should get an error if you try to fire 
it.

Original comment by philippe.beaudoin on 20 Jun 2010 at 10:44

GoogleCodeExporter commented 9 years ago

Original comment by philippe.beaudoin on 21 Jun 2010 at 6:33