开发者

Header/ Footer in MVP GWT project

How i m suppose to create header and footer for my MVP GWT application? For example, the design i was used with gwt but without mvp was, having header, footer and content panel which i used to display current view. Header and footer was singleton instances loading once in the begging.

Header instance Singleton;
Footer instance Singleton;
Content instance Singleton;
Content.getContent(Set current开发者_运维百科 view);

How could do the same following mvp model?

Thanks

Edit The MVP implementation i m using is gwt presenter.


Good article on this topic: Using GWT MVP with multiple views on the page


You can define a skeleton view, which includes a header, a footer, and a content panel. Once the skeleton view has loaded, you set the skeleton view's content panel as the panel to contain views.

In code, it looks like this:

Place targetPlace = historyMapper.getPlace(History.getToken());
if (targetPlace == null) targetPlace = defaultPlace;
placeController.goTo(skeletonPlace);
activityManager.setDisplay(skeletonView.getContentPanel());
// potentially show a "Loading.." view here
placeController.goTo(targetPlace);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜