PDA

View Full Version : [NO CODE] ComboBox applying filter to ListStore inconsistently



Kutu
12 Sep 2008, 2:27 PM
I noticed a bug/design issue in ComboBox.

1) Prepare and Populate ListStore (apple, orange, juice, sunkists, etc)
2) Put the ListStore to a ComboBox
3) Perform setValue() to ComboBox with a value contained in ListStore or try typing something to the ComboBox so the drop-down showed up automatically (fetched from ListStore)

e.g. typing "a" would give a drop down of "apple"

4) do a ListStore.indexOf(orange) after the above operation

a) if the JS is compiled via Mac GWT, it'll return the position of orange
b) if the JS is compiled via Linux GWT, it'll return -1 (due to the filter)

so on Mac, you don't need to clearFilters but on Linux you need to do that (note: must be compiled I suppose).

I don't know what's the intended result for calling indexOf() really. One thing I did notice from the code of ListStore is that it has:

1) List<M> all
2) List<M> filtered
3) List<M> snapshot

and the values are referencing each other at certain state, which is a bit confusing. If I have a ListStore<M> and I'm calling indexOf(), should I assume that it'll return the right index assuming the model is in the List?

Platform:
Mac OSX 10.5
GWT 1.5.0 RC1
GXT-1.1-Alpha2
SliceHost provided Linux

I don't know if this still happens in 1.1 alpha 4. Can someone please inform me if that is the case?

darrellmeyer
12 Sep 2008, 7:17 PM
Please post sample code that illustrates the problem you are seeing.