Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] Bug in AbstractStringToNumberValidator?
[Databinding] Bug in AbstractStringToNumberValidator? [message #316657] Thu, 14 June 2007 09:39 Go to next message
Eclipse UserFriend
Hi,

I'm using the databinding framework to bind SWT controls to POJO Models
in the context of Eclipse forms. I've written glue code which listens to
validation state changes in the binding for the control. If there is a
change I add or remove message which are display in the appropriate form
areas. I'm having a text field which is bound to an int model property.
If I enter letter in the field, a validation error is thrown and the
message in the format:

"Invalid character for value [2c] at position [2] character ²c]"

That's fine. The problem is, that the message never changes after it was
created once. I tracked down the problem to the Validator
" org.eclipse.core.internal.databinding.validation.AbstractStr ingToNumberValidator ".

There is the following code

if (result.getNumber() != null) {
...
}
} else if (result.getPosition() != null) {
if (parseErrorMessage == null) {
parseErrorMessage = StringToNumberParser
..createParseErrorMessage((String) value,
result.getPosition());
}

return ValidationStatus.error(parseErrorMessage);
}

parseErrorMessage is a member of the validator and therefore only
initialized once ;(

I'm also use the UpdateValueStrategy which creates the validators just
once as well. The user get the first created message every time.

Is that a bug or did I something wrong?

Plattform:

Eclipse 3.3m7
Windows XP Prof
JDK 1.5_09

Thanks in advance
Thomas
Re: [Databinding] Bug in AbstractStringToNumberValidator? [message #316789 is a reply to message #316657] Tue, 19 June 2007 04:04 Go to previous messageGo to next message
Eclipse UserFriend
Has no one experienced this problem? I think that's behaviour is not the
expected one. I mean that only the first validation message will be
tracked and displayed, no matter how many errors occurs later for the
same field.

Any hint or help is appreciated.
Thomas


Thomas Fahrmeyer schrieb:
> Hi,
>
> I'm using the databinding framework to bind SWT controls to POJO Models
> in the context of Eclipse forms. I've written glue code which listens to
> validation state changes in the binding for the control. If there is a
> change I add or remove message which are display in the appropriate form
> areas. I'm having a text field which is bound to an int model property.
> If I enter letter in the field, a validation error is thrown and the
> message in the format:
>
> "Invalid character for value [2c] at position [2] character ²c]"
>
> That's fine. The problem is, that the message never changes after it was
> created once. I tracked down the problem to the Validator
> " org.eclipse.core.internal.databinding.validation.AbstractStr ingToNumberValidator ".
>
>
> There is the following code
>
> if (result.getNumber() != null) {
> ...
> }
> } else if (result.getPosition() != null) {
> if (parseErrorMessage == null) {
> parseErrorMessage = StringToNumberParser
> .createParseErrorMessage((String) value,
> result.getPosition());
> }
>
> return ValidationStatus.error(parseErrorMessage);
> }
>
> parseErrorMessage is a member of the validator and therefore only
> initialized once ;(
>
> I'm also use the UpdateValueStrategy which creates the validators just
> once as well. The user get the first created message every time.
>
> Is that a bug or did I something wrong?
>
> Plattform:
>
> Eclipse 3.3m7
> Windows XP Prof
> JDK 1.5_09
>
> Thanks in advance
> Thomas
Re: [Databinding] Bug in AbstractStringToNumberValidator? [message #316953 is a reply to message #316789] Thu, 21 June 2007 21:52 Go to previous messageGo to next message
Eclipse UserFriend
That's a bug. Can you please log it in bugzilla?

-brad

Thomas Fahrmeyer wrote:
> Has no one experienced this problem? I think that's behaviour is not the
> expected one. I mean that only the first validation message will be
> tracked and displayed, no matter how many errors occurs later for the
> same field.
>
> Any hint or help is appreciated.
> Thomas
>
>
> Thomas Fahrmeyer schrieb:
>> Hi,
>>
>> I'm using the databinding framework to bind SWT controls to POJO
>> Models in the context of Eclipse forms. I've written glue code which
>> listens to validation state changes in the binding for the control. If
>> there is a change I add or remove message which are display in the
>> appropriate form areas. I'm having a text field which is bound to an
>> int model property. If I enter letter in the field, a validation error
>> is thrown and the message in the format:
>>
>> "Invalid character for value [2c] at position [2] character ²c]"
>>
>> That's fine. The problem is, that the message never changes after it
>> was created once. I tracked down the problem to the Validator
>> " org.eclipse.core.internal.databinding.validation.AbstractStr ingToNumberValidator ".
>>
>>
>> There is the following code
>>
>> if (result.getNumber() != null) {
>> ...
>> }
>> } else if (result.getPosition() != null) {
>> if (parseErrorMessage == null) {
>> parseErrorMessage = StringToNumberParser
>> .createParseErrorMessage((String) value,
>> result.getPosition());
>> }
>>
>> return ValidationStatus.error(parseErrorMessage);
>> }
>>
>> parseErrorMessage is a member of the validator and therefore only
>> initialized once ;(
>>
>> I'm also use the UpdateValueStrategy which creates the validators just
>> once as well. The user get the first created message every time.
>>
>> Is that a bug or did I something wrong?
>>
>> Plattform:
>>
>> Eclipse 3.3m7
>> Windows XP Prof
>> JDK 1.5_09
>>
>> Thanks in advance
>> Thomas
Re: [Databinding] Bug in AbstractStringToNumberValidator? [message #317102 is a reply to message #316953] Mon, 25 June 2007 22:39 Go to previous messageGo to next message
Eclipse UserFriend
Logged bug 194353[1].

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=194353

Brad Reynolds wrote:
> That's a bug. Can you please log it in bugzilla?
>
> -brad
>
> Thomas Fahrmeyer wrote:
>> Has no one experienced this problem? I think that's behaviour is not
>> the expected one. I mean that only the first validation message will
>> be tracked and displayed, no matter how many errors occurs later for
>> the same field.
>>
>> Any hint or help is appreciated.
>> Thomas
>>
>>
>> Thomas Fahrmeyer schrieb:
>>> Hi,
>>>
>>> I'm using the databinding framework to bind SWT controls to POJO
>>> Models in the context of Eclipse forms. I've written glue code which
>>> listens to validation state changes in the binding for the control.
>>> If there is a change I add or remove message which are display in the
>>> appropriate form areas. I'm having a text field which is bound to an
>>> int model property. If I enter letter in the field, a validation
>>> error is thrown and the message in the format:
>>>
>>> "Invalid character for value [2c] at position [2] character ²c]"
>>>
>>> That's fine. The problem is, that the message never changes after it
>>> was created once. I tracked down the problem to the Validator
>>> " org.eclipse.core.internal.databinding.validation.AbstractStr ingToNumberValidator ".
>>>
>>>
>>> There is the following code
>>>
>>> if (result.getNumber() != null) {
>>> ...
>>> }
>>> } else if (result.getPosition() != null) {
>>> if (parseErrorMessage == null) {
>>> parseErrorMessage = StringToNumberParser
>>> .createParseErrorMessage((String) value,
>>> result.getPosition());
>>> }
>>>
>>> return ValidationStatus.error(parseErrorMessage);
>>> }
>>>
>>> parseErrorMessage is a member of the validator and therefore only
>>> initialized once ;(
>>>
>>> I'm also use the UpdateValueStrategy which creates the validators
>>> just once as well. The user get the first created message every time.
>>>
>>> Is that a bug or did I something wrong?
>>>
>>> Plattform:
>>>
>>> Eclipse 3.3m7
>>> Windows XP Prof
>>> JDK 1.5_09
>>>
>>> Thanks in advance
>>> Thomas
Re: [Databinding] Bug in AbstractStringToNumberValidator? [message #317129 is a reply to message #317102] Tue, 26 June 2007 12:05 Go to previous message
Eclipse UserFriend
Thanks Brad,

sorry, that I didn't fill in the bug, but I was in vacation :)

Regards
Thomas


Brad Reynolds schrieb:
> Logged bug 194353[1].
>
> [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=194353
>
> Brad Reynolds wrote:
>> That's a bug. Can you please log it in bugzilla?
>>
>> -brad
>>
>> Thomas Fahrmeyer wrote:
>>> Has no one experienced this problem? I think that's behaviour is not
>>> the expected one. I mean that only the first validation message will
>>> be tracked and displayed, no matter how many errors occurs later for
>>> the same field.
>>>
>>> Any hint or help is appreciated.
>>> Thomas
>>>
>>>
>>> Thomas Fahrmeyer schrieb:
>>>> Hi,
>>>>
>>>> I'm using the databinding framework to bind SWT controls to POJO
>>>> Models in the context of Eclipse forms. I've written glue code which
>>>> listens to validation state changes in the binding for the control.
>>>> If there is a change I add or remove message which are display in
>>>> the appropriate form areas. I'm having a text field which is bound
>>>> to an int model property. If I enter letter in the field, a
>>>> validation error is thrown and the message in the format:
>>>>
>>>> "Invalid character for value [2c] at position [2] character ²c]"
>>>>
>>>> That's fine. The problem is, that the message never changes after it
>>>> was created once. I tracked down the problem to the Validator
>>>> " org.eclipse.core.internal.databinding.validation.AbstractStr ingToNumberValidator ".
>>>>
>>>>
>>>> There is the following code
>>>>
>>>> if (result.getNumber() != null) {
>>>> ...
>>>> }
>>>> } else if (result.getPosition() != null) {
>>>> if (parseErrorMessage == null) {
>>>> parseErrorMessage = StringToNumberParser
>>>> .createParseErrorMessage((String) value,
>>>> result.getPosition());
>>>> }
>>>>
>>>> return ValidationStatus.error(parseErrorMessage);
>>>> }
>>>>
>>>> parseErrorMessage is a member of the validator and therefore only
>>>> initialized once ;(
>>>>
>>>> I'm also use the UpdateValueStrategy which creates the validators
>>>> just once as well. The user get the first created message every time.
>>>>
>>>> Is that a bug or did I something wrong?
>>>>
>>>> Plattform:
>>>>
>>>> Eclipse 3.3m7
>>>> Windows XP Prof
>>>> JDK 1.5_09
>>>>
>>>> Thanks in advance
>>>> Thomas
Previous Topic:Eclipse Ant exception...Specified JRE installation does not exist...
Next Topic:Text Editor Spelling
Goto Forum:
  


Current Time: Thu Sep 18 00:14:57 EDT 2025

Powered by FUDForum. Page generated in 0.04032 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top