How to get list of items from ListStore in GWT?

398 Views Asked by At

I am working on some GWT app and I need a list of items from my RpcProxy method :

RpcProxy<PagingLoadResult<GwtAccessRole>> proxy = new RpcProxy<PagingLoadResult<GwtAccessRole>>() {

            @Override
            protected void load(Object loadConfig, AsyncCallback<PagingLoadResult<GwtAccessRole>> callback) {
                GWT_ACCESS_ROLE_SERVICE.findByUserId((PagingLoadConfig) loadConfig, currentSession.getSelectedAccount().getId(), userId, callback);

            }
        };

The only thing that I done is that I made BasePagingLoader and then ListSore:

BasePagingLoader<PagingLoadResult<GwtAccessRole>> loader = new BasePagingLoader<PagingLoadResult<GwtAccessRole>>(proxy);
        ListStore<GwtAccessRole> accessRoleStore = new ListStore<GwtAccessRole>(loader);

        for (GwtAccessRole gwtAccessRoleChecked : accessRoleStore.getModels()) {
            for (GwtRole gwtRole : roleStore.getModels()) {
                if (gwtAccessRoleChecked.getId().equals(gwtRole.getId())) {
                    listCheckedRoles.add(gwtRole);
                }
            }
        }

I tried to iterate through ListStore through accessRoleStore.getModels but it says its empty, but I know that list is not empty. Does anyone have idea how to make a list of items from this mine ListStore?

0

There are 0 best solutions below