Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: createBoundComboBox(ValueModel, ValueMode, String

  1. #1
    Join Date
    Nov 2004
    Location
    IL, USA
    Posts
    61

    Default createBoundComboBox(ValueModel, ValueMode, String

    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?

  2. #2
    Join Date
    Nov 2004
    Location
    IL, USA
    Posts
    61

    Default

    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=leftref");
    formBuilder.row();

  3. #3
    Join Date
    Aug 2004
    Posts
    229

    Default

    I have the exact same problem - haven't had time to investigate it yet, though.

  4. #4
    Join Date
    Sep 2004
    Posts
    4

    Default Me too, and not only with bound combo boxes

    I have that exact same problem too, and it isn't limited to only bound comboboxes. If I create an ordinary combo box with
    Code:
    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.

  5. #5
    Join Date
    Aug 2004
    Posts
    229

    Default

    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

  6. #6
    Join Date
    Nov 2004
    Location
    IL, USA
    Posts
    61

    Default

    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).

  7. #7
    Join Date
    Nov 2004
    Location
    IL, USA
    Posts
    61

    Default

    Ok, I resolved it, I had to add toString method to my bean to display right value.

  8. #8
    Join Date
    Aug 2004
    Posts
    229

    Default

    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

  9. #9
    Join Date
    Jan 2005
    Posts
    6

    Default

    Has this problem been fixed? I am using the latest version of RCP and I still get this problem.

  10. #10
    Join Date
    Sep 2004
    Location
    Ghent, Belgium
    Posts
    224

    Default

    The problem you're describing is related to jdk1.5. The ComboBoxAutoCompletion class fixes this problem.

    Peter

Similar Threads

  1. Replies: 17
    Last Post: Jan 2nd, 2007, 01:43 PM
  2. LDAPPasswordAuthenticationDao problem
    By benoit_m35 in forum Security
    Replies: 15
    Last Post: Jan 11th, 2006, 07:04 AM
  3. Replies: 8
    Last Post: Jul 13th, 2005, 11:20 AM
  4. URL parameters
    By adepue in forum Swing
    Replies: 5
    Last Post: Jan 17th, 2005, 01:36 PM
  5. Enlisting Custom DataSource with JTa
    By shaby775 in forum Data
    Replies: 11
    Last Post: Sep 9th, 2004, 03:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •