Saturday, December 21, 2013

Re: CellTable - ListDataProvider - Table not updating on subsequent calls

Ufff it's been so long I can't remember :( sorry and on top of it I deleted the project. I just read my own email again to see if I could tell what I was doing wrong and even now can't really tell.

Sent from my iPhone

On Dec 21, 2013, at 8:40 AM, Javed Sumra <javed.sumra@specsavers.com> wrote:

Hello Alfredo.  I am having a similar issue.  Did you get to the bottom of this?

Thanks

On Saturday, August 4, 2012 3:10:46 PM UTC+1, Alfredo Quiroga-Villamil wrote:
I am still investigating here on my side, but I have a feeling I might
be missing the obvious so if someone knows what I am missing or
potentially doing wrong please let me know.

Elements:

- A CellTable
- A ListDataProvider
- RequestFactory
- A "refresh" button

Scenario:

- The CellTable is populated via RequestFactory.
- On the first load, all data is shown in the table (all rows are populated)
- I have a button (refresh).
- The Table can be edited, so as an example I edit the first row,
first cell and simply change the text to something else.
- I click on the refresh button and load a brand new list of proxies
from the server using request factory.
- I clear my provider's list and add the new proxies.
- The new list doesn't replace the old values (previously edited).

Curiosity:

I've noticed that after I click refresh, although at first glance the
edited cell didn't change, if I click on it once or twice, it'll
correctly display the last value loaded from the server. This is very
unusual behavior. I've also tried to invoke refresh and flush on the
provider itself after adding the new set of proxies.

Presenter's code that is invoked for the first load and subsequent
ones is shown below:

        @Override
        public void readAll() {

                destinationContext = factory.getRequestFactory().createDestinationContext();
                destinationContext.findAll().with("cards", "cards.trunks",
"daysOfWeek", "daysOfWeek.hourlySchedule", "holidays")
                                .fire(new Receiver<List<DestinationProxy>>() {

                                        @Override
                                        public void onSuccess(List<DestinationProxy> proxies) {

                                                view.getDestinationCellTable().getProvider().getList().clear();
                                                view.getDestinationCellTable().getProvider().getList().addAll(proxies);

                                                if (proxies != null && proxies.size() > 0) {
                                                        view.getDestinationCellTable().getCellTable().getSelectionModel().setSelected(proxies.get(0),
true);
                                                }

                                        }

                                });

        }

I am still investigating here, but as I previously said if you see
that I am simply missing the obvious I would appreciate it if you can
let me know.

Thank you in advance,

Alfredo

--
Alfredo Quiroga-Villamil

AOL/Yahoo/Gmail/MSN IM:  lawwton

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment