-1

I am new with GWT_GXT

I use MVP(model-view-Presenter)

In Presenter, i call RPC to get data From database. After that i get a List data -> I set it for view

In view, code is below

@Override
public void setDeleteAllTest(List<DeleteAllTestModel> deleteAllTests) {
   final ListStore<DeleteAllTestModel> listStore = new ListStore<DeleteAllTestModel>();
    listStore.add(deleteAllTests);
    gridView = new PMTGridDeleteAllTest<DeleteAllTestModel>().getPMTGridDeleteAllTest(listStore);
    gridView.setAutoWidth(true);

}

@Override protected void onRender(Element parent, int pos) { super.onRender(parent, pos);

    ContentPanel cp = new ContentPanel();
    cp.setBodyBorder(false);
    cp.setHeading("");
    cp.setButtonAlign(Style.HorizontalAlignment.CENTER.CENTER);
    cp.setLayout(new FitLayout());
    cp.setSize(1200, 400);
    cp.add(gridView);

    verticalPanel.add(cp);

    verticalPanel.add(nameField);

    verticalPanel.add(cancelButton);

    add(verticalPanel);
    cancelButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
        @Override
        public void componentSelected(ButtonEvent buttonEvent) {
            PolicyDeleteAllTestDialog.this.hide();
        }
    });

    getButtonById("ok").hide();
}

The Problem is that Gird is not refresh and update new data_ It only displays (the first Grid in the first Call) .. It always keep the first View( I use dialog to show grid)..

Help me!

Thanks

thangdo
  • 21
  • 1
  • 6

1 Answers1

0

I don't exactly remember how it works and it really is what you need. But there is something like gridView.refresh();. I remember I sometime used to use grid.getView().refresh(true); but it's been a while. Also I think there is a concept named ListLoader that might be useful. I am not sure of myself but if I were you I would have a look at listLoader. I hope this will help you one way or another, sorry if it does not.

ovie
  • 621
  • 3
  • 20
  • Still if I understand your problem this might help you: http://docs.sencha.com/gxt/3.1.0-beta/ui/grid/GridLoadingRpc.html – ovie Oct 03 '14 at 14:13