Monday, November 8, 2010

Re: SelectionModel and ListDataProvider are out of synch

On a related subject why is there no 'reset'/'clear' method on the
selection model.

I find myself in the situation where I would need to reset the
selection model (affecting
a new one is not an option as I have handlers registered on the
former).

Thanks,
Mirco

On Nov 7, 7:42 pm, Mirco Dotta <mirco.do...@gmail.com> wrote:
> Hi John,
>
> > The SelectionModel shouldn't depend on the data in the ListDataProvider
> > because it is independent of the data source.  Consider a SelectionModel
> > that has an option to select all unread messages.  You probably don't have
> > all of the user messages loaded on the client, but the unread messages
> > should be selected as you page through the table, without having to update
> > the SelectionModel each time you load a new page.  
>
> Your point makes sense and I see now why the SelectionModel
> has been designed not to be tighted to the data provider. It is about
> flexibility
> and by having this design, it is easier (and feasible) to integrate a
> selection model
> when data is loaded asynchronously.
>
> > Can you deselect the value in the SelectionModel when you remove the row in
> > your onClick handler?
>
> Yes, this is what I'm currently doing... it is just that, at first
> thought, it didn't
> feel right. I was believing that removing an item from the data list
> should have automagically
> removed the item from the selection model. I just thought that the
> operation should have been
> transparent to API's clients. But I see that data pagination is a hard
> problem if you set a hard link
> between the selection model and the data provider, which gives me an
> explanation of the current
> design.
>
> Thank you again for your answer and, please, feel free to correct me
> if my comments are wrong (or just
> not understandable :).
>
> -- Mirco

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate