设置要在GWT MVP中查看的数据

时间:2013-02-12 13:24:43

标签: gwt gwt-mvp

我有一个GWT应用程序,其中遵循MVP模式。

我们有多个视图来显示UI上的数据。

我们将数据设置为通过Activity查看。像这样的东西

 public class SomeActivityImpl extends AbstractActivity implements SomeView.Presenter {

       public SomeActivityImpl{
            //some initialization goes here.
       }       

 public void start(AcceptsOneWidget containerWidget, EventBus eventBus) {
          //presenter is set here
          loadDetails();
 }

 private void loadDetails(){
        SomeRequestFactory.context().findSomeEntity().fire(new Receiver<SomeProxy>() {

        @Override
        public void onSuccess(SomeProxy proxyObject) {

          someView.setName("name");
          someview.setSurname("surname");
          someview.setMothersName("mothers name");
        }

 )
 }

现在我的问题是如何确保View的所有setter都设置好并且没有遗漏任何内容?

是否存在任何特定于GWT的解决方案,或者有人建议设计模式?

1 个答案:

答案 0 :(得分:0)

您应该使用编辑器框架。它有一个Request Factory驱动程序,可以帮助您将其用于请求Factory。 Here's a good tutorial

如果您不喜欢该教程,请考虑查看GWT的实际操作

相关问题