Post

2 followers Follow
0
Avatar

ComboBox in options

I'm trying to show a combo box with an empty default choice but the UI shows some funny line on top for an empty string.

code: 

List<Options.OptionValue> optionValues = ((DefaultAlignmentDocument) documents[0].getDocumentOrCrash()).<SequenceDocument>getSequences().stream().map(sequence ->
new Options.OptionValue(sequence.getName(), sequence.getName())).collect(Collectors.toList());
optionValues.add(0, new Options.OptionValue("none", ""));
options.addComboBoxOption("sequence", "Sequenceyyy", optionValues, optionValues.get(0));
Adrian p

Please sign in to leave a comment.

2 comments

0
Avatar

Empty is a bit ambiguous so we would normally use something like "<html><i>None</i></html>" instead.

However, you can have an empty value without the ugly line if you put a space (" ") in for the label instead of an empty string:

optionValues.add(0, new Options.OptionValue("none", " "));
Richard Moir 0 votes
Comment actions Permalink