Textbox works fine, but if I try to cancel some char input with
e.Handled = true
it doesn’t work.
Can I handle events inside objects with JavaScript?
Hello Takashi,
Keyboard events, like all events in Wisej, are routed to the server asynchronously. The Handled property is useful on the server side when managing the OnKeyDown/Up/Press events to signal that a child has handled the key. However, this has no effect on the client, unless you actually change the Text property to trigger a client update – I wouldn’t recommend this approach unless really necessary.
If you want to handle keys as they are typed and be able to stop the browser from processing the key you have to do it on the client using the JavaScript provider. It’s quite easy with Wisej. I have attached a sample project for you to use as a reference and a screen shot below of the script editor.
Keeping the script above as a reference, we attach the “keypress” handler and handle the event. To stop it from both bubbling and “defaulting” use e.stop(). Otherwise you can use e.stopBubbling() and e.preventDefault().
When you work directly in javascript we enter the qooxdoo realm. The full API is here: http://demo.qooxdoo.org/current/apiviewer/#qx
Thanks Takashi,
we have logged this bug in our tracking system as WJ-7225.
We will post a new answer here when it is resolved.