参数这里是我的历史价值变动事件处理程序:GWT - 在片段
public void onValueChange(ValueChangeEvent<String> event) {
String token = event.getValue();
if (token != null) {
if (token.equals("!list")) {
GWT.runAsync(new RunAsyncCallback() {
public void onFailure(Throwable caught) {
}
public void onSuccess() {
presenter = new ContactsPresenter(rpcService, eventBus, new ContactsView());
presenter.go(container);
}
});
}
else if (token.equals("!add")) {
GWT.runAsync(new RunAsyncCallback() {
public void onFailure(Throwable caught) {
}
public void onSuccess() {
presenter = new EditContactPresenter(rpcService, eventBus, new EditContactView());
presenter.go(container);
}
});
}
else if (token.equals("!edit")) {
GWT.runAsync(new RunAsyncCallback() {
public void onFailure(Throwable caught) {
}
public void onSuccess() {
presenter = new EditContactPresenter(rpcService, eventBus, new EditContactView());
presenter.go(container);
}
});
}
}
正如你所看到的,要www.domain.com/#edit负载高达编辑视图。但是,我将如何在片段中指定一个参数,例如一个ID,并将其传递给Edit Contacts Presenter?
所有的www.domain.com/#edit/1
是的,比我想象的要简单得多!谢谢! – 2010-07-15 16:29:55