Why getSelectedItem().getDisplayString() returns <Strong>a</Strong>bc where it should return only abc for suggestion box in gwt

64 Views Asked by At

I am working with Suggestion box in gwt, I have applied a selectionHandler on that suggestion box. If I select "abc" value then getSelectedItem().getDisplaySring() should return "abc" instead it returns <strong>a</strong>bc.

Can someone help in this situation.. Why it returns wrong result.?

view.getMySuggetsionBox().addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {

        @Override
        public void onSelection(SelectionEvent<Suggestion> event) {
            Window.alert(event.getSelectedItem().getDisplayString());

        }
    });
1

There are 1 best solutions below

0
Thomas Broyer On

I suppose you're just actually looking for getReplacementString rather than getDisplayString.

Keep in mind that a suggest box is a text box with suggestions, not a select box / combo box with typeahead.