Hi guys! I need to do the next. I have a TextField and when the value change I need to call a functionA(). But when the user press the enter key I need first to call functionA() and second functionB(), in that order.
Hi Olli! The problem is that I need functionA() should always be called when a value in TextField change but functionB() should only be called when enter key is press.
I tried to put a flag but the problem is more complicated. I need to use the TextField value for some operations but addKeyDownListener() is called always before addValueChangeListener(). And when addKeyDownListener() is called TextField value hasn’t been set yet because addValueChangeListener hasn’t been called.
as a sidenote, the value change listener isn’t the one that updates the value, but rather, it reacts to the change event in the browser, which hasn’t occurred yet in the case of the keyboard shortcut.
I’ve a scenario where when user presses ENTER key, he/she wants the focus moved to another component. Say, there are two text fields and one button. When user presses ENTEY key, automatically move foucs from textfield 1 to textfield 2 and then to button.