You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Patrick Klein <pa...@bi-so.de> on 2007/01/05 18:17:01 UTC

Problem with Number Translator in Tapestry 4.1.2 Snapshot

Hi!

I just recognized that the NumberTranslator does not seem to work 
correctly. OmitZero=true results in no value shown in the form-field 
after a rewind but the value "0" is stored inside the corresponding 
Long- (or Integer / BigDecimal / ...) variable. OmitZero=false shows the 
stored "0" in the form-field.

Has anyone recognized this behaviour, too and if yes is there a 
workaround (except writing your own NumberTranslator)? Or is this 
Problem maybe allready known and fixed...?

I'm using this mornings (GMT+1) Tapestry 4.1.2 Snapshot from mvn-snapshot.

Regards,
    Patrick

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Problem with Number Translator in Tapestry 4.1.2 Snapshot

Posted by Julian Wood <wo...@ucalgary.ca>.
I've just updated an app from 4.0.2 to 4.1.2-SNAPSHOT, current as of  
Feb 23rd, and can confirm that this is still a problem.

Previously (in 4.0.2) if you left a text field (say it was a score)  
empty, the field would take on the value of 0 (can't imagine why you  
would ever want this, but that's what it does).
If you set the omitZero parameter on the NumberTranslator on this  
field to true, then, it would remain null (desired behaviour) when  
empty.

In 4.1.2-SNAPSHOT, it always converts to 0, regardless of the value  
of the omitZero parameter (bad).

J

On 8-Jan-07, at 9:56 AM, Jesse Kuhnert wrote:

> This was a jira issue "fixed" recently. I'm not sure I understand what
> the expected->actual results are that are questionable.
>
> On 1/8/07, Patrick Klein <pa...@bi-so.de> wrote:
>> Hi!
>>
>> After a little testing:
>> The behaviour of the NumberTranslater is persistent in version 4.1.1.
>> Switching back to 4.0.2 for now, which is nothing i want to do as i'd
>> like to use the ajax functionality of tap 4.1.x ...
>>
>> Regards,
>>     Patrick
>> > Hi!
>> >
>> > I just recognized that the NumberTranslator does not seem to work
>> > correctly. OmitZero=true results in no value shown in the form- 
>> field
>> > after a rewind but the value "0" is stored inside the corresponding
>> > Long- (or Integer / BigDecimal / ...) variable. OmitZero=false  
>> shows
>> > the stored "0" in the form-field.
>> >
>> > Has anyone recognized this behaviour, too and if yes is there a
>> > workaround (except writing your own NumberTranslator)? Or is this
>> > Problem maybe allready known and fixed...?
>> >
>> > I'm using this mornings (GMT+1) Tapestry 4.1.2 Snapshot from
>> > mvn-snapshot.
>> >
>> > Regards,
>> >    Patrick
>>
--
Julian Wood <wo...@ucalgary.ca>

Software Engineer
Teaching & Learning Centre
University of Calgary

http://tlc.ucalgary.ca



Re: Problem with Number Translator in Tapestry 4.1.2 Snapshot

Posted by Patrick Klein <pa...@bi-so.de>.
Hi!
> This was a jira issue "fixed" recently. I'm not sure I understand what
> the expected->actual results are that are questionable.
I check the source-code and realized that it is standard for the 
NumberTranslater to default to Double(0) if the field is empty. I found 
the old version (empty field defaults to null-value) more convenient and 
internally extended the NumberTanslater to this "old" (as in Tapestry 
4.0.x) behavior as some of our validators rely heavily on that circumstance.
Really strange for the user is that even if the field is shown as empty 
by taperstry's NumberTranslator (4.1.x, omitZero=true) the 
RequiredValidator lets the field pass as valid as the underlying value 
is not empty...

Regards,
    Patrick
>
> On 1/8/07, Patrick Klein <pa...@bi-so.de> wrote:
>> Hi!
>>
>> After a little testing:
>> The behaviour of the NumberTranslater is persistent in version 4.1.1.
>> Switching back to 4.0.2 for now, which is nothing i want to do as i'd
>> like to use the ajax functionality of tap 4.1.x ...
>>
>> Regards,
>>     Patrick
>> > Hi!
>> >
>> > I just recognized that the NumberTranslator does not seem to work
>> > correctly. OmitZero=true results in no value shown in the form-field
>> > after a rewind but the value "0" is stored inside the corresponding
>> > Long- (or Integer / BigDecimal / ...) variable. OmitZero=false shows
>> > the stored "0" in the form-field.
>> >
>> > Has anyone recognized this behaviour, too and if yes is there a
>> > workaround (except writing your own NumberTranslator)? Or is this
>> > Problem maybe allready known and fixed...?
>> >
>> > I'm using this mornings (GMT+1) Tapestry 4.1.2 Snapshot from
>> > mvn-snapshot.
>> >
>> > Regards,
>> >    Patrick
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Problem with Number Translator in Tapestry 4.1.2 Snapshot

Posted by Jesse Kuhnert <jk...@gmail.com>.
This was a jira issue "fixed" recently. I'm not sure I understand what
the expected->actual results are that are questionable.

On 1/8/07, Patrick Klein <pa...@bi-so.de> wrote:
> Hi!
>
> After a little testing:
> The behaviour of the NumberTranslater is persistent in version 4.1.1.
> Switching back to 4.0.2 for now, which is nothing i want to do as i'd
> like to use the ajax functionality of tap 4.1.x ...
>
> Regards,
>     Patrick
> > Hi!
> >
> > I just recognized that the NumberTranslator does not seem to work
> > correctly. OmitZero=true results in no value shown in the form-field
> > after a rewind but the value "0" is stored inside the corresponding
> > Long- (or Integer / BigDecimal / ...) variable. OmitZero=false shows
> > the stored "0" in the form-field.
> >
> > Has anyone recognized this behaviour, too and if yes is there a
> > workaround (except writing your own NumberTranslator)? Or is this
> > Problem maybe allready known and fixed...?
> >
> > I'm using this mornings (GMT+1) Tapestry 4.1.2 Snapshot from
> > mvn-snapshot.
> >
> > Regards,
> >    Patrick
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Problem with Number Translator in Tapestry 4.1.2 Snapshot

Posted by Patrick Klein <pa...@bi-so.de>.
Hi!

After a little testing:
The behaviour of the NumberTranslater is persistent in version 4.1.1. 
Switching back to 4.0.2 for now, which is nothing i want to do as i'd 
like to use the ajax functionality of tap 4.1.x ...

Regards,
    Patrick
> Hi!
>
> I just recognized that the NumberTranslator does not seem to work 
> correctly. OmitZero=true results in no value shown in the form-field 
> after a rewind but the value "0" is stored inside the corresponding 
> Long- (or Integer / BigDecimal / ...) variable. OmitZero=false shows 
> the stored "0" in the form-field.
>
> Has anyone recognized this behaviour, too and if yes is there a 
> workaround (except writing your own NumberTranslator)? Or is this 
> Problem maybe allready known and fixed...?
>
> I'm using this mornings (GMT+1) Tapestry 4.1.2 Snapshot from 
> mvn-snapshot.
>
> Regards,
>    Patrick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org