Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    To get the value that has been typed so far in comboboxitem

    Hi,

    We are using the isomorphic version: 6.1-p20190721
    My current functionality uses SmartGWT

    How can we retrieve the so far typed value in the Combobox item search field?

    I tried the following code:
    item.addKeyPressHandler(event ->{


    GWT.log(((ComboBoxItem) event.getItem()).getEnteredValue());
    });


    but facing one issue with getEnteredValue() method

    1. When we type "g" it prints nothing in the console.
    2. when we type "gf" it prints only "g" on the console.
    3. When we type "gfh" it prints "gf" on the console.


    Any reason for the specific behavior or there is some other which we can use?

    Thanks.

    #2
    In the KeyPress event you can still cancel the key being input. So you can either use KeyUp instead, or just combine the typed value with the entered value so far (note, not quite trivial since you would need to handle special keys like backspace).

    Comment

    Working...
    X