1

フィルター可能なコンボボックスが必要です。入力テキストをクリックするとカーソルが表示されるので、テキストに文字を挿入できます。

入力ボックスに入力すると、コンボボックス内の項目がフィルター処理されるため、以前のテキストは不要になりました。次のいずれかを行います。

  1. 入力テキストをクリアする
  2. すべてのテキストを選択します(入力を開始すると、テキストがクリアされます)-http://dev.vaadin.com/ticket/7116によると、これは不可能です
4

1 に答える 1

0

I have test this on vaadin textfields, it should work for combos too. You can clear the text on the input capturing the focus event, as in the comments, but instead of using null, use the empty string "", the change will not be seen until you call requestRepaint on the component.

       input.addListener(new FieldEvents.FocusListener() {
            @Override
            public void focus(FocusEvent event) {
                input.setValue("");
                input.requestRepaint();
            }
        });

However for this to work you has to lose the focus and gain it again, playing with the valueChange event (override, etc) could be better.

于 2014-04-25T16:37:34.680 に答える