troels
unread,Aug 2, 2010, 2:08:44 PM8/2/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
  to GWT Presenter
Hello people
I have this TabLayoutPanel, and I am trying to map each of these tabs
to their own #TabName token, so that when you click a tab and switch
to that tab, the token changes, and when you load the view/presenter
with a valid token present, you are navigated to the corresponding
tab. Now I am very new to the whole MVP thing, and it is my first time
using gwt-presenter library, but before I used it, I have made kind of
my own placemanager (worked in quite a different way though) to
accomplish this.
So what I am really wondering is how I can achieve this goal with gwt-
presenter?
My set-up is as follows:
MainPageView.java
MainPageView.ui.xml
MainPagePresenter.java.
in MainPagePresenter I have tried the following:
@Override
protected void onBind() {
        display.getTabPanel().addSelectionHandler(new
SelectionHandler<Integer>() {
            public void onSelection(SelectionEvent<Integer> event) {
                tabIndex = event.getSelectedItem();
                place = new Place(pages[tabIndex]);
                place.requestWith("hej", "jeh");
            }
        });
    }
and:
@Override
    protected void onPlaceRequest(PlaceRequest request) {
        place = request.getPlace();
        for (int i = 0; i < pages.length; i++) {
            if (place.getId().equals(pages[i])) {
                tabIndex = i;
                display.selectTab(i);
                break;
            }
        }
    }
Have I completely misunderstood the purpose of the places part of gwt-
presenter?
thanks :)