You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Leon Nieuwoudt <le...@gmail.com> on 2010/01/21 13:37:02 UTC

AutoCompleteTextField and HTML Encoding question (1.4.4)

Hi :)

I'm trying to use a AutoCompleteTextField that shows a list of E-Mail
addresses. The problem I'm running into is that the "<" character is causing
rendering issues, for example: John Doe <john . doe @ mortuary . com>.

I've already bypassed the selection list rendering problem by using a custom
renderer (code below), but now when I select an entry it only copies the
first part up to the "<" into the textbox.

Any quick way around it?

Thanks in advance

------------------------

private class KeyRenderer extends AbstractAutoCompleteTextRenderer<Key> {
        @Override
        protected String getTextValue(Key object) {
            return Strings.escapeMarkup(object.getName()).toString();
        }
    }

...

add(new AutoCompleteTextField<Key>("key", model, new KeyRenderer()) {
       @Override
        protected Iterator<Key> getChoices(String input) {
            return keyService.getPublicKeyFor(input).iterator();
       }
});

....