Only if u kill the user before he does that!  :)

But if u are satisfied with filtering what's being pressed you can do
like this (example uses uibinding syntax):

@UiHandler("inputValue")
void onInputValueInserted(KeyUpEvent e) {
        if(!inputValue.getText().isEmpty()) {
                if(!inputValue.getText().matches("[1-9]\\d{0,}")) { // I want to
filter out what's not a number and those numbers starting with 0
                        inputValue.setText(inputValue.getText().subSequence(0,
inputValue.getText().length() - 1).toString()); // remove the last
char
                }
        }
}

HTH,
C

On Mar 15, 12:17 am, Magno Machado <[email protected]> wrote:
> Is it possible to prevent a key from being pressed on an textbox?
>
> --
> Magno Machado 
> Paulohttp://blog.magnomachado.com.brhttp://code.google.com/p/emballo/

-- 
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