How to add Nested presenter to slot, that will change browser url to presenter's name token when revealing?

169 Views Asked by At

How to add Nested presenter to slot, that will change browser url to presenter's name token when revealing?

I use GWT 2.7 and GWTP 1.5.

Please help.

2

There are 2 best solutions below

0
Tomasz Kańka On

I think you should reverse your logic.

Set url in your browser and this would reveal your presenter.

0
Michael Wiles On

You use the place manager

From the link:

some sample code:

@Inject
CarsPresenter(
        EventBus eventBus,
        MyView view,
        MyProxy proxy,
        PlaceManager placeManager) {
    super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);

    this.placeManager = placeManager;
}

    public void displayCar(String model) {
    PlaceRequest placeRequest = new PlaceRequest.Builder()
            .nameToken(NameTokens.CARS)
            .with(ParameterTokens.MODEL, model)
            .build();

    placeManager.revealPlace(placeRequest);
}

This will cause the presenter identified by NameTokens.CAR to be revealed and the prepareFromRequest method called in that presenter...