Hi Cameron

My guess is that you don't fire an event after setting the selected
element on the combo box model.

Your model should look something like below...

I hope this solves your issue.

Etienne



public class DateComboBoxModel extends AbstractListModel
                               implements IComboBoxModel {
    public Object getSelectedItem() {
        return _selectedItem;
    }

    public void setSelectedItem(Object inItem) {
        selectIfChanged(inItem);
    }

    private void selectIfChanged(Object inItem) {
        if (!ObjectUtils.equals(_selectedItem, inItem)) {
            _selectedItem = inItem;
            fireContentsChanged(this, -1, -1);
        }
    }

    private Object _selectedItem;
}



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:ulc-developer-
> [EMAIL PROTECTED] On Behalf Of Cameron Taggart
> Sent: Tuesday, May 02, 2006 5:37 PM
> To: [email protected]
> Subject: [ULC-developer] ComboBox List<Date> setSelectedIndex(0)
> 
> I created a DateComboBox and DateComboBoxModel which simply display
> List<Date>.  Selecting a date is optional on my form, so the first
> date in the list, I've set to null.  I have a "clear" button on my
> form which needs to reset the ComboBox to the first item.  Right now,
> the model gets changed to the correct value, but the ComboBox in the
> UI does not.  Any idea how I might get the ComboBox selection to
> visually change to the selected item?  Was there an event I was
> supposed to fire off?
> 
> Thanks,
> Cameron
> _______________________________________________
> ULC-developer mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/ulc-developer
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to