我是GWT的新手,並試圖實施活動和地點。我正面臨UI的問題。我無法發佈圖片,因爲我是Stackoverflow的新手,並且沒有10個聲望點,但我在左側看到了一個面板兩次。我還附加了啓動器代碼和UI綁定代碼。GWT的地方和活動 - 獲取重複的UI
public class SmartEBRM implements EntryPoint {
//private Place defaultPlace = new SmartEBRMViewPlace("World!");
@SuppressWarnings("deprecation")
@Override
public void onModuleLoad() {
// TODO Auto-generated method stub
ClientFactory clientFactory = GWT.create(ClientFactory.class);
EventBus eventBus = clientFactory.getEventBus();
PlaceController placeController = clientFactory.getPlaceController();
// Start ActivityManager for the main widget with our ActivityMapper
ActivityMapper activityMapper = new AppActivityMapper(clientFactory);
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
SmartEBRMViewImpl smartViewImpl = new SmartEBRMViewImpl();
activityManager.setDisplay (smartViewImpl.getHTMLPannel());
// Start PlaceHistoryHandler with our PlaceHistoryMapper
AppPlaceHistoryMapper historyMapper= GWT.create(AppPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
SmartEBRMViewPlace smartViewPlace = new SmartEBRMViewPlace();
historyHandler.register(placeController, eventBus, smartViewPlace);
historyHandler.handleCurrentHistory();
RootPanel.get().add(smartViewImpl);
}
}
和
public class SmartEBRMViewImpl extends Composite implements SmartEBRMView{
private static SmartEBRMViewImplUiBinder uiBinder = GWT
.create(SmartEBRMViewImplUiBinder.class);
@UiField DockLayoutPanel docLayoutPanel;
@UiField StackPanel stackPanel;
@UiField Button enterpriseView;
@UiField Button testComponent;
@UiField SimplePanel centerPanel;
private Presenter listener;
interface SmartEBRMViewImplUiBinder extends
UiBinder<Widget, SmartEBRMViewImpl> {
}
public SmartEBRMViewImpl() {
initWidget(uiBinder.createAndBindUi(this));
}
public SmartEBRMViewImpl(String firstName) {
initWidget(uiBinder.createAndBindUi(this));
}
@Override
public void setPresenter(Presenter listener) {
// TODO Auto-generated method stub
this.listener = listener;
}
public SimplePanel getHTMLPannel() {
return centerPanel;
}
@UiHandler("enterpriseView")
public void onClearButtonClick(ClickEvent e)
{
listener.goTo(new EnterpriseInvoiceCompareViewPlace());
}
}
你爲什麼壓制「棄用」?你使用舊版本的EventBus嗎? –