View Full Version : createBoundComboBox(ValueModel, ValueMode, String
Jurijus Jarmakas
Jan 3rd, 2005, 07:47 PM
I am using createBoundComboBox(ValueModel, Value Model, String...
when I am clicking on the combobox everything looks ok, but when I move mouse to select an item it becomes invisible ??? (there is some kind of magic going on)
any help?
Jurijus Jarmakas
Jan 4th, 2005, 06:20 AM
final List sexValues = new SexValues().getSexValues();
class SexWrapper extends ValueModelWrapper {
public SexWrapper(ValueModel valueModel) {
super(valueModel);
}
public Object getValue() throws IllegalArgumentException {
// from sex to sexValue object
return super.getValue();
}
public void setValue(Object value) throws IllegalArgumentException {
// set from sexValue object to sex
super.setValue(value);
}
}
ValueModel sexListHolder = new ValueHolder(sexValues);
SexValue sexValue = (SexValue) sexValues.get(1);
ValueModel selectedHolder = new SexWrapper( new ValueHolder(sexValue) );
JComboBox sexSelector = getFormModel().createBoundComboBox(selectedHolder,
sexListHolder, "description1");
formBuilder.getLayoutBuilder().cell( new JLabel("Sex") );
formBuilder.getLayoutBuilder().cell( sexSelector, "colSpec=left:pref");
formBuilder.row();
adepue
Jan 4th, 2005, 11:10 AM
I have the exact same problem - haven't had time to investigate it yet, though.
vpeurala
Jan 7th, 2005, 05:27 AM
I have that exact same problem too, and it isn't limited to only bound comboboxes. If I create an ordinary combo box with
JComboBox combo = new JComboBox();
I still have that same problem in a Spring-RCP application.
Could it be that somebody sets some static property affecting all comboboxes somewhere in Spring-RCP? I started to get these "invisible" items after I updated Spring-RCP from CVS about a week ago.
I am using Java 1.5 update 1.
adepue
Jan 7th, 2005, 06:24 PM
I'm using Java 1.5 as well... I wonder if that could be common amongst us all? I'm also using jgoodies looks. One could wonder if there is a strange interaction between Java 1.5, jgoodies looks, and possibly spring-rich? I do know that if I use the nifty auto completing combobox feature of spring-rich that the problem goes away (for those particular comboboxes).
- Andy
Jurijus Jarmakas
Jan 7th, 2005, 07:27 PM
I tried
new ComboBoxAutoCompletion( jcombobox );
It fixed the above described problem but introduced another one: it does not display correctly selected value, it shows the string value of the object which is a bean (the values in the drop down list are showing correctly).
Jurijus Jarmakas
Jan 8th, 2005, 11:48 AM
Ok, I resolved it, I had to add toString method to my bean to display right value.
adepue
Jan 10th, 2005, 10:11 AM
toString() is a workaround - but this is a bug that has been recently fixed in cvs I believe. With the fix it should pull the currently selected value from the property just as the list does.
- Andy
TRiNiTy
Feb 3rd, 2005, 07:41 PM
Has this problem been fixed? I am using the latest version of RCP and I still get this problem.
pdbruycker
Feb 4th, 2005, 02:06 PM
The problem you're describing is related to jdk1.5. The ComboBoxAutoCompletion class fixes this problem.
Peter
Jurijus Jarmakas
Feb 4th, 2005, 03:36 PM
if you look into source of ComboBoxAutoCompletion you will see that it is based on http://www.orbital-computer.de/JComboBox/ . I did not succseed in updating the list of values in combobox which uses ComboBoxAutoCompletion, althouth I was successfull updating list of values when I use AutoCompletion from http://www.orbital-computer.de/JComboBox/
pdbruycker
Feb 12th, 2005, 08:56 AM
I committed a fix that fixes this problem. When the model of the combobox changes, the ComboBoxAutoCompletion support still works.
Hope this helps,
Peter
Manus
May 12th, 2005, 09:41 AM
Hello,
Please, could you take a look at my new topic?
http://forum.springframework.org/viewtopic.php?t=5491
TIA,
Mauro.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.