You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Reinier Mostert <re...@clabo.co.za> on 2004/06/15 00:14:51 UTC

TextField and number types - behaviour changed in 3.0 final

Hi All,

First off, I know this was discussed earlier on the list (around Oct
2003), but I was hit by an upgrade last night.

I upgraded from Tapestry 3-b4 to Tapestry 3.0 final, and suddenly all
TextFields that is used to edit a number stopped working.

I used to use a TextField and pass it a BigDecimal or an Integer, and it
just worked, like so:
<span jwcid="@TextField" value="ognl:turnover.netTurnover"/>

where getNetTurnover() returns a java.Math.BigDecimal directly from
Cayenne.

Now, half the pages in my app has stopped working with the following
message:
Parameter value (19,160.78) is an instance of java.math.BigDecimal,
which does not inherit from java.lang.String.

The only supporting lib I updated is commons-digester-1.4.jar, which
went to commons-digester-1.5.jar.

I know the official line is that this should never work, and that I
should use a NumberValidator with the TextField to do this, but this is
STILL working in my production system, and has been for almost a year.

Any ideas of what to do or where to hunt for what caused this change?

Thanks 
reinier


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


Re: TextField and number types - behaviour changed in 3.0 final

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 14, 2004, at 11:31 PM, Glen Stampoultzis wrote:
>
> I have a vague memory of Erik exposing some of the ognl type 
> conversion stuff through tapestry.  Perhaps this changed things.

Actually something changed when the optimizations were made for when to 
instrument classes (I believe).

You used to be able to bind a TextField to any type you liked (or so I 
recall) and OGNL would do the type conversions.  Now you can only bind 
a TextField to a String - and this sucks.  Even Struts does implicit 
data type conversion much nicer than Tapestry does at the moment.  My 
OGNL type converter stuff doesn't even get a chance to come into play 
currently, I don't think.  OGNL by default does some basic conversions 
like String <--> int - but with my type converter enhancement it could 
be made to automatically do String <--> Whatever.  I don't always have 
time to figure out and fix the underlying issues we come across, and 
often for the sake of pragmatic project momentum use a workaround (in 
this case using ValidField).

I'm a bit fuzzy on the details at the moment, but I do know something 
changed for the worse during one of the 3.0 RC releases.  This ties 
into the wiki page Howard just started for improved validation, so I'll 
review that later today and add my thoughts there.

	Erik


>
> -- Glen
>
> At 10:22 AM 15/06/2004, you wrote:
>> How did it ever work?  OGNL must have been doing some secret 
>> conversions on us.
>>
>> --
>> Howard M. Lewis Ship
>> Independent J2EE / Open-Source Java Consultant
>> Creator, Jakarta Tapestry
>> Creator, Jakarta HiveMind
>> http://howardlewisship.com
>>
>>
>> > -----Original Message-----
>> > From: Reinier Mostert [mailto:rendier@clabo.co.za]
>> > Sent: Monday, June 14, 2004 6:15 PM
>> > To: tapestry-user@jakarta.apache.org
>> > Subject: TextField and number types - behaviour changed in 3.0 final
>> >
>> >
>> > Hi All,
>> >
>> > First off, I know this was discussed earlier on the list (around Oct
>> > 2003), but I was hit by an upgrade last night.
>> >
>> > I upgraded from Tapestry 3-b4 to Tapestry 3.0 final, and suddenly 
>> all
>> > TextFields that is used to edit a number stopped working.
>> >
>> > I used to use a TextField and pass it a BigDecimal or an
>> > Integer, and it
>> > just worked, like so:
>> > <span jwcid="@TextField" value="ognl:turnover.netTurnover"/>
>> >
>> > where getNetTurnover() returns a java.Math.BigDecimal directly from
>> > Cayenne.
>> >
>> > Now, half the pages in my app has stopped working with the following
>> > message:
>> > Parameter value (19,160.78) is an instance of java.math.BigDecimal,
>> > which does not inherit from java.lang.String.
>> >
>> > The only supporting lib I updated is commons-digester-1.4.jar, which
>> > went to commons-digester-1.5.jar.
>> >
>> > I know the official line is that this should never work, and that I
>> > should use a NumberValidator with the TextField to do this,
>> > but this is
>> > STILL working in my production system, and has been for almost a 
>> year.
>> >
>> > Any ideas of what to do or where to hunt for what caused this 
>> change?
>> >
>> > Thanks
>> > reinier
>> >
>> >
>> > 
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> Glen Stampoultzis
> gstamp@iinet.net.au
> http://members.iinet.net.au/~gstamp/glen/


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


RE: TextField and number types - behaviour changed in 3.0 final

Posted by Glen Stampoultzis <gs...@iinet.net.au>.
I have a vague memory of Erik exposing some of the ognl type conversion 
stuff through tapestry.  Perhaps this changed things.

-- Glen

At 10:22 AM 15/06/2004, you wrote:
>How did it ever work?  OGNL must have been doing some secret conversions 
>on us.
>
>--
>Howard M. Lewis Ship
>Independent J2EE / Open-Source Java Consultant
>Creator, Jakarta Tapestry
>Creator, Jakarta HiveMind
>http://howardlewisship.com
>
>
> > -----Original Message-----
> > From: Reinier Mostert [mailto:rendier@clabo.co.za]
> > Sent: Monday, June 14, 2004 6:15 PM
> > To: tapestry-user@jakarta.apache.org
> > Subject: TextField and number types - behaviour changed in 3.0 final
> >
> >
> > Hi All,
> >
> > First off, I know this was discussed earlier on the list (around Oct
> > 2003), but I was hit by an upgrade last night.
> >
> > I upgraded from Tapestry 3-b4 to Tapestry 3.0 final, and suddenly all
> > TextFields that is used to edit a number stopped working.
> >
> > I used to use a TextField and pass it a BigDecimal or an
> > Integer, and it
> > just worked, like so:
> > <span jwcid="@TextField" value="ognl:turnover.netTurnover"/>
> >
> > where getNetTurnover() returns a java.Math.BigDecimal directly from
> > Cayenne.
> >
> > Now, half the pages in my app has stopped working with the following
> > message:
> > Parameter value (19,160.78) is an instance of java.math.BigDecimal,
> > which does not inherit from java.lang.String.
> >
> > The only supporting lib I updated is commons-digester-1.4.jar, which
> > went to commons-digester-1.5.jar.
> >
> > I know the official line is that this should never work, and that I
> > should use a NumberValidator with the TextField to do this,
> > but this is
> > STILL working in my production system, and has been for almost a year.
> >
> > Any ideas of what to do or where to hunt for what caused this change?
> >
> > Thanks
> > reinier
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/

Re: TextField and number types - behaviour changed in 3.0 final

Posted by Glen Stampoultzis <gs...@iinet.net.au>.
At 04:30 AM 16/06/2004, you wrote:
>Hi,
>
>This sounds close to what the behaviour was.
>
>My app is basically a reporting tool - 80% of the fields will only be
>used by me to configure it, and I know what values should be entered
>into every field.  Adding validation on these fields is wasted effort,
>in my opinion.  For the other 20%, I am and will definitely be using
>validation.
>
>To summarize, is there any chance that this behaviour will come back?
>If so, will the timescale be 3.1 or earlier?  (I have to decide if I
>want to go through my app and convert that 80% of fields to ValidFields
>;-( ).  Otherwise, I'll just go back to the beta that worked till it is
>sorted.

You could always checkout the 3.0 source find the problem, fix it and send 
in a patch.

-- Glen 

Re: TextField and number types - behaviour changed in 3.0 final

Posted by Reinier Mostert <re...@clabo.co.za>.
Hi,

This sounds close to what the behaviour was.  

My app is basically a reporting tool - 80% of the fields will only be
used by me to configure it, and I know what values should be entered
into every field.  Adding validation on these fields is wasted effort,
in my opinion.  For the other 20%, I am and will definitely be using
validation.

To summarize, is there any chance that this behaviour will come back? 
If so, will the timescale be 3.1 or earlier?  (I have to decide if I
want to go through my app and convert that 80% of fields to ValidFields
;-( ).  Otherwise, I'll just go back to the beta that worked till it is
sorted.

Thanks in advance
reinier

On Tue, 2004-06-15 at 18:12, Erik Hatcher wrote:
> On Jun 15, 2004, at 9:39 AM, Todd O'Bryan wrote:
> > I wonder if it might be a good idea to have TextField by default bind 
> > to any Object. Filling in the value could be done with toString(), and 
> > by reflection you could call a parseObject() method for whatever 
> > Object you're binding to.
> >
> > I'm aware you'd have problems because people could type strings that 
> > aren't parsable into the type you want, but is there any reason you 
> > couldn't return null as an error value, since it should be almost 
> > impossible to enter a null object as a String?
> 
> This is the whole point of the OGNL type converter extension in 
> Tapestry.  This is the solution to the problem, in my opinion.  I just 
> wish TextField was "fixed" back to how it was.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Re: TextField and number types - behaviour changed in 3.0 final

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 15, 2004, at 9:39 AM, Todd O'Bryan wrote:
> I wonder if it might be a good idea to have TextField by default bind 
> to any Object. Filling in the value could be done with toString(), and 
> by reflection you could call a parseObject() method for whatever 
> Object you're binding to.
>
> I'm aware you'd have problems because people could type strings that 
> aren't parsable into the type you want, but is there any reason you 
> couldn't return null as an error value, since it should be almost 
> impossible to enter a null object as a String?

This is the whole point of the OGNL type converter extension in 
Tapestry.  This is the solution to the problem, in my opinion.  I just 
wish TextField was "fixed" back to how it was.


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


Re: TextField and number types - behaviour changed in 3.0 final

Posted by Todd O'Bryan <to...@mac.com>.
But, do PropertyEditors exist by default for Integer and Double? Those 
are what 90% of the people are going to want to be able to enter 90% of 
the time...

Todd

On Jun 15, 2004, at 11:16 AM, Howard M. Lewis Ship wrote:

> Another alternative is to make use of JavaBeans PropertyEditor to 
> perform a default string-to-object
> translation.
>
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Jakarta Tapestry
> Creator, Jakarta HiveMind
> http://howardlewisship.com
>
>
>> -----Original Message-----
>> From: Todd O'Bryan [mailto:toddobryan@mac.com]
>> Sent: Tuesday, June 15, 2004 9:39 AM
>> To: Tapestry users
>> Subject: Re: TextField and number types - behaviour changed
>> in 3.0 final
>>
>>
>> I wonder if it might be a good idea to have TextField by
>> default bind
>> to any Object. Filling in the value could be done with
>> toString(), and
>> by reflection you could call a parseObject() method for
>> whatever Object
>> you're binding to.
>>
>> I'm aware you'd have problems because people could type strings that
>> aren't parsable into the type you want, but is there any reason you
>> couldn't return null as an error value, since it should be almost
>> impossible to enter a null object as a String?
>>
>> I realize this isn't ideal, and it just encourages people to not
>> validate their input, but I think it should be easy to set up a
>> TextField quickly, since that will encourage people to use the
>> framework. Later, after they've been burned (or after they've played
>> with it and before they get burned, if they're cautious), let
>> them dig
>> through the code to validate the values in the field.
>>
>> Just my $.02,
>> Todd
>>
>> On Jun 15, 2004, at 4:51 AM, Erik Hatcher wrote:
>>
>>>
>>> On Jun 15, 2004, at 1:32 AM, Glen Stampoultzis wrote:
>>>>
>>>> You might want to checkout the bottom of this page:
>>>>
>>>> http://tinyurl.com/24ykw
>>>>
>>>> for specifying a OGNL type converter.
>>>
>>>
>>> Just to clarify - this does *not* currently solve the
>> problem.  The
>>> issue is that TextField 'value' can only bind to a String.
>> The type
>>> converter extension doesn't even get a chance to come into
>> play sadly.
>>>
>>> 	Erik
>>>
>>>>
>>>> Regards,
>>>>
>>>> Glen
>>>>
>>>> At 10:29 AM 15/06/2004, Reinier Mostert wrote:
>>>>> Well, as discussed before this is very useful for
>> testing, etc.  If
>>>>> you
>>>>> would like I can perform any tests or checks neccessary to help
>>>>> restore
>>>>> this behaviour.
>>>>>
>>>>> A couple of people on the list have requested this rather
>> vehemently
>>>>> as
>>>>> well ;-).
>>>>>
>>>>> I think I'm in a way different timezone, so comms might
>> be sporadic.
>>>>>
>>>>> cheers
>>>>> reinier
>>>>>
>>>>> On Tue, 2004-06-15 at 02:22, Howard M. Lewis Ship wrote:
>>>>>> How did it ever work?  OGNL must have been doing some secret
>>>>> conversions on us.
>>>>>>
>>>>>> --
>>>>>> Howard M. Lewis Ship
>>>>>> Independent J2EE / Open-Source Java Consultant
>>>>>> Creator, Jakarta Tapestry
>>>>>> Creator, Jakarta HiveMind
>>>>>> http://howardlewisship.com
>>>>>>
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Reinier Mostert [mailto:rendier@clabo.co.za]
>>>>>>> Sent: Monday, June 14, 2004 6:15 PM
>>>>>>> To: tapestry-user@jakarta.apache.org
>>>>>>> Subject: TextField and number types - behaviour
>> changed in 3.0
>>>>> final
>>>>>>>
>>>>>>>
>>>>>>> Hi All,
>>>>>>>
>>>>>>> First off, I know this was discussed earlier on the
>> list (around
>>>>> Oct
>>>>>>> 2003), but I was hit by an upgrade last night.
>>>>>>>
>>>>>>> I upgraded from Tapestry 3-b4 to Tapestry 3.0 final, and
>>>>> suddenly all
>>>>>>> TextFields that is used to edit a number stopped working.
>>>>>>>
>>>>>>> I used to use a TextField and pass it a BigDecimal or an
>>>>>>> Integer, and it
>>>>>>> just worked, like so:
>>>>>>> <span jwcid="@TextField" value="ognl:turnover.netTurnover"/>
>>>>>>>
>>>>>>> where getNetTurnover() returns a java.Math.BigDecimal
>> directly
>>>>> from
>>>>>>> Cayenne.
>>>>>>>
>>>>>>> Now, half the pages in my app has stopped working with the
>>>>> following
>>>>>>> message:
>>>>>>> Parameter value (19,160.78) is an instance of
>>>>> java.math.BigDecimal,
>>>>>>> which does not inherit from java.lang.String.
>>>>>>>
>>>>>>> The only supporting lib I updated is
>> commons-digester-1.4.jar,
>>>>> which
>>>>>>> went to commons-digester-1.5.jar.
>>>>>>>
>>>>>>> I know the official line is that this should never work, and
>>>>> that I
>>>>>>> should use a NumberValidator with the TextField to do this,
>>>>>>> but this is
>>>>>>> STILL working in my production system, and has been
>> for almost a
>>>>> year.
>>>>>>>
>>>>>>> Any ideas of what to do or where to hunt for what
>> caused this
>>>>> change?
>>>>>>>
>>>>>>> Thanks
>>>>>>> reinier
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail:
>>>>> tapestry-user-unsubscribe@jakarta.apache.org
>>>>>>> For additional commands, e-mail:
>>>>> tapestry-user-help@jakarta.apache.org
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail:
>>>>> tapestry-user-unsubscribe@jakarta.apache.org
>>>>>> For additional commands, e-mail:
>>>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail:
>> tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail:
>>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>> Glen Stampoultzis
>>>> gstamp@iinet.net.au
>>>> http://members.iinet.net.au/~gstamp/glen/
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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


RE: TextField and number types - behaviour changed in 3.0 final

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Another alternative is to make use of JavaBeans PropertyEditor to perform a default string-to-object
translation.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com


> -----Original Message-----
> From: Todd O'Bryan [mailto:toddobryan@mac.com] 
> Sent: Tuesday, June 15, 2004 9:39 AM
> To: Tapestry users
> Subject: Re: TextField and number types - behaviour changed 
> in 3.0 final
> 
> 
> I wonder if it might be a good idea to have TextField by 
> default bind  
> to any Object. Filling in the value could be done with 
> toString(), and  
> by reflection you could call a parseObject() method for 
> whatever Object  
> you're binding to.
> 
> I'm aware you'd have problems because people could type strings that  
> aren't parsable into the type you want, but is there any reason you  
> couldn't return null as an error value, since it should be almost  
> impossible to enter a null object as a String?
> 
> I realize this isn't ideal, and it just encourages people to not  
> validate their input, but I think it should be easy to set up a  
> TextField quickly, since that will encourage people to use the  
> framework. Later, after they've been burned (or after they've played  
> with it and before they get burned, if they're cautious), let 
> them dig  
> through the code to validate the values in the field.
> 
> Just my $.02,
> Todd
> 
> On Jun 15, 2004, at 4:51 AM, Erik Hatcher wrote:
> 
> >
> > On Jun 15, 2004, at 1:32 AM, Glen Stampoultzis wrote:
> >>
> >> You might want to checkout the bottom of this page:
> >>
> >> http://tinyurl.com/24ykw
> >>
> >> for specifying a OGNL type converter.
> >
> >
> > Just to clarify - this does *not* currently solve the 
> problem.  The  
> > issue is that TextField 'value' can only bind to a String.  
> The type  
> > converter extension doesn't even get a chance to come into 
> play sadly.
> >
> > 	Erik
> >
> >>
> >> Regards,
> >>
> >> Glen
> >>
> >> At 10:29 AM 15/06/2004, Reinier Mostert wrote:
> >>> Well, as discussed before this is very useful for 
> testing, etc.  If  
> >>> you
> >>> would like I can perform any tests or checks neccessary to help  
> >>> restore
> >>> this behaviour.
> >>>
> >>> A couple of people on the list have requested this rather 
> vehemently  
> >>> as
> >>> well ;-).
> >>>
> >>> I think I'm in a way different timezone, so comms might 
> be sporadic.
> >>>
> >>> cheers
> >>> reinier
> >>>
> >>> On Tue, 2004-06-15 at 02:22, Howard M. Lewis Ship wrote:
> >>> > How did it ever work?  OGNL must have been doing some secret  
> >>> conversions on us.
> >>> >
> >>> > --
> >>> > Howard M. Lewis Ship
> >>> > Independent J2EE / Open-Source Java Consultant
> >>> > Creator, Jakarta Tapestry
> >>> > Creator, Jakarta HiveMind
> >>> > http://howardlewisship.com
> >>> >
> >>> >
> >>> > > -----Original Message-----
> >>> > > From: Reinier Mostert [mailto:rendier@clabo.co.za]
> >>> > > Sent: Monday, June 14, 2004 6:15 PM
> >>> > > To: tapestry-user@jakarta.apache.org
> >>> > > Subject: TextField and number types - behaviour 
> changed in 3.0  
> >>> final
> >>> > >
> >>> > >
> >>> > > Hi All,
> >>> > >
> >>> > > First off, I know this was discussed earlier on the 
> list (around  
> >>> Oct
> >>> > > 2003), but I was hit by an upgrade last night.
> >>> > >
> >>> > > I upgraded from Tapestry 3-b4 to Tapestry 3.0 final, and  
> >>> suddenly all
> >>> > > TextFields that is used to edit a number stopped working.
> >>> > >
> >>> > > I used to use a TextField and pass it a BigDecimal or an
> >>> > > Integer, and it
> >>> > > just worked, like so:
> >>> > > <span jwcid="@TextField" value="ognl:turnover.netTurnover"/>
> >>> > >
> >>> > > where getNetTurnover() returns a java.Math.BigDecimal 
> directly  
> >>> from
> >>> > > Cayenne.
> >>> > >
> >>> > > Now, half the pages in my app has stopped working with the  
> >>> following
> >>> > > message:
> >>> > > Parameter value (19,160.78) is an instance of  
> >>> java.math.BigDecimal,
> >>> > > which does not inherit from java.lang.String.
> >>> > >
> >>> > > The only supporting lib I updated is 
> commons-digester-1.4.jar,  
> >>> which
> >>> > > went to commons-digester-1.5.jar.
> >>> > >
> >>> > > I know the official line is that this should never work, and  
> >>> that I
> >>> > > should use a NumberValidator with the TextField to do this,
> >>> > > but this is
> >>> > > STILL working in my production system, and has been 
> for almost a  
> >>> year.
> >>> > >
> >>> > > Any ideas of what to do or where to hunt for what 
> caused this  
> >>> change?
> >>> > >
> >>> > > Thanks
> >>> > > reinier
> >>> > >
> >>> > >
> >>> > >  
> >>> 
> ---------------------------------------------------------------------
> >>> > > To unsubscribe, e-mail:  
> >>> tapestry-user-unsubscribe@jakarta.apache.org
> >>> > > For additional commands, e-mail:  
> >>> tapestry-user-help@jakarta.apache.org
> >>> > >
> >>> >
> >>> >
> >>> >  
> >>> 
> ---------------------------------------------------------------------
> >>> > To unsubscribe, e-mail:  
> >>> tapestry-user-unsubscribe@jakarta.apache.org
> >>> > For additional commands, e-mail:  
> >>> tapestry-user-help@jakarta.apache.org
> >>>
> >>>
> >>> 
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: 
> tapestry-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail:  
> >>> tapestry-user-help@jakarta.apache.org
> >>
> >>
> >> Glen Stampoultzis
> >> gstamp@iinet.net.au
> >> http://members.iinet.net.au/~gstamp/glen/
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


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


Re: TextField and number types - behaviour changed in 3.0 final

Posted by Todd O'Bryan <to...@mac.com>.
I wonder if it might be a good idea to have TextField by default bind  
to any Object. Filling in the value could be done with toString(), and  
by reflection you could call a parseObject() method for whatever Object  
you're binding to.

I'm aware you'd have problems because people could type strings that  
aren't parsable into the type you want, but is there any reason you  
couldn't return null as an error value, since it should be almost  
impossible to enter a null object as a String?

I realize this isn't ideal, and it just encourages people to not  
validate their input, but I think it should be easy to set up a  
TextField quickly, since that will encourage people to use the  
framework. Later, after they've been burned (or after they've played  
with it and before they get burned, if they're cautious), let them dig  
through the code to validate the values in the field.

Just my $.02,
Todd

On Jun 15, 2004, at 4:51 AM, Erik Hatcher wrote:

>
> On Jun 15, 2004, at 1:32 AM, Glen Stampoultzis wrote:
>>
>> You might want to checkout the bottom of this page:
>>
>> http://tinyurl.com/24ykw
>>
>> for specifying a OGNL type converter.
>
>
> Just to clarify - this does *not* currently solve the problem.  The  
> issue is that TextField 'value' can only bind to a String.  The type  
> converter extension doesn't even get a chance to come into play sadly.
>
> 	Erik
>
>>
>> Regards,
>>
>> Glen
>>
>> At 10:29 AM 15/06/2004, Reinier Mostert wrote:
>>> Well, as discussed before this is very useful for testing, etc.  If  
>>> you
>>> would like I can perform any tests or checks neccessary to help  
>>> restore
>>> this behaviour.
>>>
>>> A couple of people on the list have requested this rather vehemently  
>>> as
>>> well ;-).
>>>
>>> I think I'm in a way different timezone, so comms might be sporadic.
>>>
>>> cheers
>>> reinier
>>>
>>> On Tue, 2004-06-15 at 02:22, Howard M. Lewis Ship wrote:
>>> > How did it ever work?  OGNL must have been doing some secret  
>>> conversions on us.
>>> >
>>> > --
>>> > Howard M. Lewis Ship
>>> > Independent J2EE / Open-Source Java Consultant
>>> > Creator, Jakarta Tapestry
>>> > Creator, Jakarta HiveMind
>>> > http://howardlewisship.com
>>> >
>>> >
>>> > > -----Original Message-----
>>> > > From: Reinier Mostert [mailto:rendier@clabo.co.za]
>>> > > Sent: Monday, June 14, 2004 6:15 PM
>>> > > To: tapestry-user@jakarta.apache.org
>>> > > Subject: TextField and number types - behaviour changed in 3.0  
>>> final
>>> > >
>>> > >
>>> > > Hi All,
>>> > >
>>> > > First off, I know this was discussed earlier on the list (around  
>>> Oct
>>> > > 2003), but I was hit by an upgrade last night.
>>> > >
>>> > > I upgraded from Tapestry 3-b4 to Tapestry 3.0 final, and  
>>> suddenly all
>>> > > TextFields that is used to edit a number stopped working.
>>> > >
>>> > > I used to use a TextField and pass it a BigDecimal or an
>>> > > Integer, and it
>>> > > just worked, like so:
>>> > > <span jwcid="@TextField" value="ognl:turnover.netTurnover"/>
>>> > >
>>> > > where getNetTurnover() returns a java.Math.BigDecimal directly  
>>> from
>>> > > Cayenne.
>>> > >
>>> > > Now, half the pages in my app has stopped working with the  
>>> following
>>> > > message:
>>> > > Parameter value (19,160.78) is an instance of  
>>> java.math.BigDecimal,
>>> > > which does not inherit from java.lang.String.
>>> > >
>>> > > The only supporting lib I updated is commons-digester-1.4.jar,  
>>> which
>>> > > went to commons-digester-1.5.jar.
>>> > >
>>> > > I know the official line is that this should never work, and  
>>> that I
>>> > > should use a NumberValidator with the TextField to do this,
>>> > > but this is
>>> > > STILL working in my production system, and has been for almost a  
>>> year.
>>> > >
>>> > > Any ideas of what to do or where to hunt for what caused this  
>>> change?
>>> > >
>>> > > Thanks
>>> > > reinier
>>> > >
>>> > >
>>> > >  
>>> ---------------------------------------------------------------------
>>> > > To unsubscribe, e-mail:  
>>> tapestry-user-unsubscribe@jakarta.apache.org
>>> > > For additional commands, e-mail:  
>>> tapestry-user-help@jakarta.apache.org
>>> > >
>>> >
>>> >
>>> >  
>>> ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail:  
>>> tapestry-user-unsubscribe@jakarta.apache.org
>>> > For additional commands, e-mail:  
>>> tapestry-user-help@jakarta.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:  
>>> tapestry-user-help@jakarta.apache.org
>>
>>
>> Glen Stampoultzis
>> gstamp@iinet.net.au
>> http://members.iinet.net.au/~gstamp/glen/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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


Re: TextField and number types - behaviour changed in 3.0 final

Posted by Glen Stampoultzis <gs...@iinet.net.au>.
At 06:51 PM 15/06/2004, you wrote:
>Just to clarify - this does *not* currently solve the problem.  The issue 
>is that TextField 'value' can only bind to a String.  The type converter 
>extension doesn't even get a chance to come into play sadly.


ACKed



Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/

Re: TextField and number types - behaviour changed in 3.0 final

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 15, 2004, at 1:32 AM, Glen Stampoultzis wrote:
>
> You might want to checkout the bottom of this page:
>
> http://tinyurl.com/24ykw
>
> for specifying a OGNL type converter.


Just to clarify - this does *not* currently solve the problem.  The 
issue is that TextField 'value' can only bind to a String.  The type 
converter extension doesn't even get a chance to come into play sadly.

	Erik

>
> Regards,
>
> Glen
>
> At 10:29 AM 15/06/2004, Reinier Mostert wrote:
>> Well, as discussed before this is very useful for testing, etc.  If 
>> you
>> would like I can perform any tests or checks neccessary to help 
>> restore
>> this behaviour.
>>
>> A couple of people on the list have requested this rather vehemently 
>> as
>> well ;-).
>>
>> I think I'm in a way different timezone, so comms might be sporadic.
>>
>> cheers
>> reinier
>>
>> On Tue, 2004-06-15 at 02:22, Howard M. Lewis Ship wrote:
>> > How did it ever work?  OGNL must have been doing some secret 
>> conversions on us.
>> >
>> > --
>> > Howard M. Lewis Ship
>> > Independent J2EE / Open-Source Java Consultant
>> > Creator, Jakarta Tapestry
>> > Creator, Jakarta HiveMind
>> > http://howardlewisship.com
>> >
>> >
>> > > -----Original Message-----
>> > > From: Reinier Mostert [mailto:rendier@clabo.co.za]
>> > > Sent: Monday, June 14, 2004 6:15 PM
>> > > To: tapestry-user@jakarta.apache.org
>> > > Subject: TextField and number types - behaviour changed in 3.0 
>> final
>> > >
>> > >
>> > > Hi All,
>> > >
>> > > First off, I know this was discussed earlier on the list (around 
>> Oct
>> > > 2003), but I was hit by an upgrade last night.
>> > >
>> > > I upgraded from Tapestry 3-b4 to Tapestry 3.0 final, and suddenly 
>> all
>> > > TextFields that is used to edit a number stopped working.
>> > >
>> > > I used to use a TextField and pass it a BigDecimal or an
>> > > Integer, and it
>> > > just worked, like so:
>> > > <span jwcid="@TextField" value="ognl:turnover.netTurnover"/>
>> > >
>> > > where getNetTurnover() returns a java.Math.BigDecimal directly 
>> from
>> > > Cayenne.
>> > >
>> > > Now, half the pages in my app has stopped working with the 
>> following
>> > > message:
>> > > Parameter value (19,160.78) is an instance of 
>> java.math.BigDecimal,
>> > > which does not inherit from java.lang.String.
>> > >
>> > > The only supporting lib I updated is commons-digester-1.4.jar, 
>> which
>> > > went to commons-digester-1.5.jar.
>> > >
>> > > I know the official line is that this should never work, and that 
>> I
>> > > should use a NumberValidator with the TextField to do this,
>> > > but this is
>> > > STILL working in my production system, and has been for almost a 
>> year.
>> > >
>> > > Any ideas of what to do or where to hunt for what caused this 
>> change?
>> > >
>> > > Thanks
>> > > reinier
>> > >
>> > >
>> > > 
>> ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: 
>> tapestry-user-unsubscribe@jakarta.apache.org
>> > > For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>> > >
>> >
>> >
>> > 
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> Glen Stampoultzis
> gstamp@iinet.net.au
> http://members.iinet.net.au/~gstamp/glen/


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


RE: TextField and number types - behaviour changed in 3.0 final

Posted by Glen Stampoultzis <gs...@iinet.net.au>.
You might want to checkout the bottom of this page:

http://tinyurl.com/24ykw

for specifying a OGNL type converter.

Regards,

Glen

At 10:29 AM 15/06/2004, Reinier Mostert wrote:
>Well, as discussed before this is very useful for testing, etc.  If you
>would like I can perform any tests or checks neccessary to help restore
>this behaviour.
>
>A couple of people on the list have requested this rather vehemently as
>well ;-).
>
>I think I'm in a way different timezone, so comms might be sporadic.
>
>cheers
>reinier
>
>On Tue, 2004-06-15 at 02:22, Howard M. Lewis Ship wrote:
> > How did it ever work?  OGNL must have been doing some secret 
> conversions on us.
> >
> > --
> > Howard M. Lewis Ship
> > Independent J2EE / Open-Source Java Consultant
> > Creator, Jakarta Tapestry
> > Creator, Jakarta HiveMind
> > http://howardlewisship.com
> >
> >
> > > -----Original Message-----
> > > From: Reinier Mostert [mailto:rendier@clabo.co.za]
> > > Sent: Monday, June 14, 2004 6:15 PM
> > > To: tapestry-user@jakarta.apache.org
> > > Subject: TextField and number types - behaviour changed in 3.0 final
> > >
> > >
> > > Hi All,
> > >
> > > First off, I know this was discussed earlier on the list (around Oct
> > > 2003), but I was hit by an upgrade last night.
> > >
> > > I upgraded from Tapestry 3-b4 to Tapestry 3.0 final, and suddenly all
> > > TextFields that is used to edit a number stopped working.
> > >
> > > I used to use a TextField and pass it a BigDecimal or an
> > > Integer, and it
> > > just worked, like so:
> > > <span jwcid="@TextField" value="ognl:turnover.netTurnover"/>
> > >
> > > where getNetTurnover() returns a java.Math.BigDecimal directly from
> > > Cayenne.
> > >
> > > Now, half the pages in my app has stopped working with the following
> > > message:
> > > Parameter value (19,160.78) is an instance of java.math.BigDecimal,
> > > which does not inherit from java.lang.String.
> > >
> > > The only supporting lib I updated is commons-digester-1.4.jar, which
> > > went to commons-digester-1.5.jar.
> > >
> > > I know the official line is that this should never work, and that I
> > > should use a NumberValidator with the TextField to do this,
> > > but this is
> > > STILL working in my production system, and has been for almost a year.
> > >
> > > Any ideas of what to do or where to hunt for what caused this change?
> > >
> > > Thanks
> > > reinier
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/

RE: TextField and number types - behaviour changed in 3.0 final

Posted by Reinier Mostert <re...@clabo.co.za>.
Well, as discussed before this is very useful for testing, etc.  If you
would like I can perform any tests or checks neccessary to help restore
this behaviour.

A couple of people on the list have requested this rather vehemently as
well ;-).

I think I'm in a way different timezone, so comms might be sporadic.

cheers
reinier

On Tue, 2004-06-15 at 02:22, Howard M. Lewis Ship wrote:
> How did it ever work?  OGNL must have been doing some secret conversions on us.
> 
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Jakarta Tapestry
> Creator, Jakarta HiveMind
> http://howardlewisship.com
> 
> 
> > -----Original Message-----
> > From: Reinier Mostert [mailto:rendier@clabo.co.za] 
> > Sent: Monday, June 14, 2004 6:15 PM
> > To: tapestry-user@jakarta.apache.org
> > Subject: TextField and number types - behaviour changed in 3.0 final
> > 
> > 
> > Hi All,
> > 
> > First off, I know this was discussed earlier on the list (around Oct
> > 2003), but I was hit by an upgrade last night.
> > 
> > I upgraded from Tapestry 3-b4 to Tapestry 3.0 final, and suddenly all
> > TextFields that is used to edit a number stopped working.
> > 
> > I used to use a TextField and pass it a BigDecimal or an 
> > Integer, and it
> > just worked, like so:
> > <span jwcid="@TextField" value="ognl:turnover.netTurnover"/>
> > 
> > where getNetTurnover() returns a java.Math.BigDecimal directly from
> > Cayenne.
> > 
> > Now, half the pages in my app has stopped working with the following
> > message:
> > Parameter value (19,160.78) is an instance of java.math.BigDecimal,
> > which does not inherit from java.lang.String.
> > 
> > The only supporting lib I updated is commons-digester-1.4.jar, which
> > went to commons-digester-1.5.jar.
> > 
> > I know the official line is that this should never work, and that I
> > should use a NumberValidator with the TextField to do this, 
> > but this is
> > STILL working in my production system, and has been for almost a year.
> > 
> > Any ideas of what to do or where to hunt for what caused this change?
> > 
> > Thanks 
> > reinier
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


RE: TextField and number types - behaviour changed in 3.0 final

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
How did it ever work?  OGNL must have been doing some secret conversions on us.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com


> -----Original Message-----
> From: Reinier Mostert [mailto:rendier@clabo.co.za] 
> Sent: Monday, June 14, 2004 6:15 PM
> To: tapestry-user@jakarta.apache.org
> Subject: TextField and number types - behaviour changed in 3.0 final
> 
> 
> Hi All,
> 
> First off, I know this was discussed earlier on the list (around Oct
> 2003), but I was hit by an upgrade last night.
> 
> I upgraded from Tapestry 3-b4 to Tapestry 3.0 final, and suddenly all
> TextFields that is used to edit a number stopped working.
> 
> I used to use a TextField and pass it a BigDecimal or an 
> Integer, and it
> just worked, like so:
> <span jwcid="@TextField" value="ognl:turnover.netTurnover"/>
> 
> where getNetTurnover() returns a java.Math.BigDecimal directly from
> Cayenne.
> 
> Now, half the pages in my app has stopped working with the following
> message:
> Parameter value (19,160.78) is an instance of java.math.BigDecimal,
> which does not inherit from java.lang.String.
> 
> The only supporting lib I updated is commons-digester-1.4.jar, which
> went to commons-digester-1.5.jar.
> 
> I know the official line is that this should never work, and that I
> should use a NumberValidator with the TextField to do this, 
> but this is
> STILL working in my production system, and has been for almost a year.
> 
> Any ideas of what to do or where to hunt for what caused this change?
> 
> Thanks 
> reinier
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


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