verifyEvent.doit = false does not work [message #136925] |
Thu, 18 June 2009 14:02 |
Martin Kubitza Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Hello,
I am using a simple verifylistener that allows only E F I S T or backspace.
This works fine in RCP:
If typing any other characters than the allowed the message is displayed
and the wrong character is revoked (because of doit=false).
if (!(verifyEvent.text.toUpperCase().matches("[EFIST]"))
& !(verifyEvent.keyCode==SWT.BS))
{
MessageDialog.openError(
PlatformUI.getWorkbench().
getActiveWorkbenchWindow().getShell()
, "Error"
, "Eingabefehler:\n"
+ "Es sind nur E, F, I, S oder T erlaubt.");
verifyEvent.doit = false;
}
But within RAP the doit=false has no effect!
The message appears, but the wrong character still remains in the textfield.
And even backspace is not accepted as valid character in RAP (in RCP it is).
Are these bugs or features ??
(I am using RAP-Target v120-RC2)
Regards,
Martin Kubitza
T&P Bochum, Germany
|
|
|
Re: verifyEvent.doit = false does not work [message #136975 is a reply to message #136925] |
Thu, 18 June 2009 14:44 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Martin,
are you aware of this bug:
244008: VerifyEvent field values differ from SWT
https://bugs.eclipse.org/bugs/show_bug.cgi?id=244008
In the Controls Demo - TextTab.java there is an example for "numbers
only" verify listener.
Best,
Ivan
Martin Kubitza wrote:
> Hello,
>
> I am using a simple verifylistener that allows only E F I S T or
> backspace.
>
> This works fine in RCP:
> If typing any other characters than the allowed the message is
> displayed and the wrong character is revoked (because of doit=false).
>
> if (!(verifyEvent.text.toUpperCase().matches("[EFIST]"))
> & !(verifyEvent.keyCode==SWT.BS))
> {
>
> MessageDialog.openError(
> PlatformUI.getWorkbench().
> getActiveWorkbenchWindow().getShell()
> , "Error"
> , "Eingabefehler:\n"
> + "Es sind nur E, F, I, S oder T erlaubt.");
>
> verifyEvent.doit = false;
> }
>
> But within RAP the doit=false has no effect!
>
> The message appears, but the wrong character still remains in the
> textfield.
>
> And even backspace is not accepted as valid character in RAP (in RCP
> it is).
>
> Are these bugs or features ??
>
> (I am using RAP-Target v120-RC2)
>
>
> Regards,
> Martin Kubitza
> T&P Bochum, Germany
|
|
|
Powered by
FUDForum. Page generated in 0.02715 seconds