How do I create a non-editable GXT ComboBox?

Brian Pipa picture Brian Pipa · Mar 25, 2010 · Viewed 9.8k times · Source

I'm using GWT/GXT and trying to create a "normal" ComboBox - one that you cannot type in, but you can type a single character and it will automatically go to the first item in the list that starts with that letter. So, I don't want it READONLY, I want it so that you cannot replace the text in it with your own text (can't type characters into it).

I cannot figure out how to get ComboBox or SimpleComboBox to do this. I've tried every combination of settings on it to no avail. I did see there is a GXT ListBox, but i need a component that extends from Field.

Is there really no way to do this or am I missing something?

Answer

Brian picture Brian · Aug 18, 2012

Old post but this is very frustrating, I agree. The below is probably what you're looking for.

SimpleComboBox<String> names = new SimpleComboBox<String>();
names.add( "Brian" );
names.add( "Kevin" );
names.add( "Katie" );
names.setTriggerAction( TriggerAction.ALL );