On 13 avr, 05:37, Alexander Orlov <[email protected]> wrote:
> With the setKey(char) method it was possible to change user input in a
> TextArea/TextBox character-wise on-the-fly. Since GWT 1.6 setKey is
> deprecated. What should I use now?
>
> I think of a hack à la:
>
> onKeyPress > getText() and replace the last character according to a
> HashMap > setText(new_Text_With_Replaced_Last_Character)
>
> ...but the performance may be awful with long texts. Is there any
> other way?

Use JSNI to do the equivalent of TextBoxBase.setKey? Or maybe rather
"just" cancelling the event and instead firing a KeyPressEvent at the
event source, with the key you want.

But TextBoxBase.setKey was deprecated for a reason (only worked in IE,
as per the @Deprecated documentation in the JavaDoc), so you should
really find another, better way (I think the cancel + fire another
event is the "blessed" way of doing it now), unless you're only
targetting IE...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to