ggeorg / gwt-mosaic

Automatically exported from code.google.com/p/gwt-mosaic
1 stars 0 forks source link

DefaultComboBoxModel setSelectedItem throws IndexOutOfBoundException #50

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
What I want to do is to deselect selected item in combo. First , I usIte 
ComboBox setSelectedIndex with index -1, like Swing. But it did not work, 
because, setSelectedIndex method reject -1 as index. 
Then , I checked , DefaultComboBoxModel setSelectedItem method. it says 
that it will accept null values. But, it throws below exception,

[ERROR] Uncaught exception escaped
java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.Vector.get(Vector.java:696)
    at org.gwt.mosaic.ui.client.list.DefaultComboBoxModel.getElementAt
(DefaultComboBoxModel.java:70)
    at org.gwt.mosaic.ui.client.ListBox.contentsChanged
(ListBox.java:167)
    at 
org.gwt.mosaic.ui.client.list.DefaultComboBoxModel.fireContentsChanged
(DefaultComboBoxModel.java:44)
    at 
org.gwt.mosaic.ui.client.list.DefaultComboBoxModel.setSelectedItem
(DefaultComboBoxModel.java:105)

What is the expected output? What do you see instead?
deselect selected combo item.. 

What version of the product are you using? On what operating system?
gwt-mosaic-0.2.0-rc3
windows vista

Please provide any additional information below.

Original issue reported on code.google.com by gurselk...@gmail.com on 14 May 2009 at 3:20

GoogleCodeExporter commented 9 years ago

Original comment by georgopo...@gmail.com on 14 May 2009 at 11:23

GoogleCodeExporter commented 9 years ago
Hi,

DefaultComboBoxModel.setSelectedItem() should work now:

http://code.google.com/p/gwt-mosaic/source/detail?r=835

Thanks,
George.

Original comment by georgopo...@gmail.com on 15 May 2009 at 9:10

GoogleCodeExporter commented 9 years ago
Hi,

First of all,  I wanna thank for your effort. 
DefaultComboBoxModel.setSelectedItem() 
is working now. But these modifications unfortunately broke my incremental 
search 
combo. After these changes, Whenever ComboBox setSelectedIndex or model 
setSelectedItem method is called, popup is closed and the combo editor is 
filled 
with the selected item. The behaviour should be like that, whenever popupwindow 
is 
visible, setSelectedIndex or setSelectedItem should not cause above behaviour. 
User 
should press the enter to change the selected item of the combo, when the popup 
window is visible.

I hope i could express what my requirements are..

Thanks again..

Original comment by gurselk...@gmail.com on 18 May 2009 at 3:57

GoogleCodeExporter commented 9 years ago
Hi,

it must be OK now

http://code.google.com/p/gwt-mosaic/source/detail?r=844

Thanks,
George.

Original comment by georgopo...@gmail.com on 18 May 2009 at 8:32

GoogleCodeExporter commented 9 years ago
Hi,

Thanks again george. But the latest changes also are not useful for me. I have 
attached a combo demo. you can see the combobox behaviour by means of this 
demo. 

Thanks again..

Original comment by gurselk...@gmail.com on 19 May 2009 at 8:31

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry I didn't check very well yesterday...

Here is another fix http://code.google.com/p/gwt-mosaic/source/detail?r=845

Thanks for your help,
George.

Original comment by georgopo...@gmail.com on 19 May 2009 at 9:20

GoogleCodeExporter commented 9 years ago
Hi,

Unfortunately, combobox behaviour again is not consistent. You can easily check 
with 
combobox demo that I have posted yesterday. It is a prototype for incremental 
search 
combo. 

Thanks for your efforts..

Gursel

Original comment by gurselk...@gmail.com on 20 May 2009 at 7:22

GoogleCodeExporter commented 9 years ago
Hi Gursel,

what I see there is that while typing only the last character is visible on the 
text
box. I was working on incremental search last Saturday but I started with a 
ListBox
not with ComboBox directly. I will commit next week after I finish the
FilteredListModel. If you like please send me any patches you have for ComboBox 
that
work for you.

Thanks,
George.

Original comment by georgopo...@gmail.com on 20 May 2009 at 9:12

GoogleCodeExporter commented 9 years ago
Hi,
I am working in the same poject with Gursel.
What is the final situation?
Is there any new suggestion about Gursel's issue?
Thanks.

Original comment by a_inan...@yahoo.com on 18 Jun 2009 at 1:37

GoogleCodeExporter commented 9 years ago
Hi,

DefaultComboBox & ListBox have been redesigned in 0.2.1, see:

http://groups.google.com/group/gwt-mosaic/browse_thread/thread/38231a1362039922

do you have still the same problem? I also added a new list model 
(FilterProxyListModel).

Kind Regards,
George.

Original comment by georgopo...@gmail.com on 19 Jun 2009 at 2:04

GoogleCodeExporter commented 9 years ago
Hi George, 

I have supposed that I have solved the problem.. You should comment 
updateInput() 
line of selectedItemChanged() method of ListDataListener inner class inside 
ComboBox 
constructor.. 

Regards

Gursel 

Original comment by gurselk...@gmail.com on 22 Jun 2009 at 11:12

GoogleCodeExporter commented 9 years ago
Hi, by commenting out updateInput() the default functionality does not work.

Kind Regards,
George.

Original comment by georgopo...@gmail.com on 11 Jul 2009 at 7:55