I'm not keen on the proposed changes to setAcceptableValues and
setValue. ValuePicker is supposed to be usable as a thin wrapper around
a CellList, without even calling setAcceptableValues.

With your proposed changes, setValue would break the list as soon as you
use pagination (getVisibleItems() wouldn't returned the whole list of
"acceptable values", only the visible ones).

The fix for issue 5478 is limited to the added constructor
(Renderer,ProvidesKey) and constructing the SingleSelectionModel with an
explicit ProvidesKey.

I'm fine with the change using setRowData(List) rather than
setRowData(int,List) though; it was IMO a bug in the original
implementation.


http://gwt-code-reviews.appspot.com/1614807/diff/1/user/src/com/google/gwt/user/client/ui/ValuePicker.java
File user/src/com/google/gwt/user/client/ui/ValuePicker.java (right):

http://gwt-code-reviews.appspot.com/1614807/diff/1/user/src/com/google/gwt/user/client/ui/ValuePicker.java#newcode50
user/src/com/google/gwt/user/client/ui/ValuePicker.java:50: public
ValuePicker(CellList<T> cellList, ProvidesKey<T> keyProvider) {
What if one passes a different key provider as the one used to create
the CellList?
Shouldn't the fix rather be to ask the CellList for its key provider?
I.e. smodel = new SingleSelectionModel<T>(cellList.getKeyProvider());

http://gwt-code-reviews.appspot.com/1614807/diff/1/user/src/com/google/gwt/user/client/ui/ValuePicker.java#newcode70
user/src/com/google/gwt/user/client/ui/ValuePicker.java:70: public
ValuePicker(Renderer<T> renderer, ProvidesKey<T> keyProvider) {
I suppose keyProvider was meant to be passed to the CellList ctor?

http://gwt-code-reviews.appspot.com/1614807/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to