You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by David Brown <db...@sexingtechnologies.com> on 2009/04/08 01:15:24 UTC

Wicket Noob: Long cannot be cast to java.lang.String

Hello Wicket dev, gurus and mortals, I was successfully using Wicket to build the UI for my new web-app gig. I have studied the javadoc: org.apache.wicket.markup.html.form, org.apache.wicket.MarkupContainer and others until bleary-eyed. The web-page I am using will display correctly the values for Long and Integer in a HTML text input dialog but when I try to Save (write the value back to the DB) I get the following error condition. I can only work with String data and nothing else using the wicket ids. Please advise, David.

**************************************************************
org.apache.wicket.WicketRuntimeException: Exception 'java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String' occurred during validation org.apache.wicket.validation.validator.StringValidator$MaximumLengthValidator on component 1:editform:weight     at org.apache.wicket.markup.html.form.FormComponent.validateValidators(FormComponent.java:1510)

There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement).

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


Re: Wicket Noob: Long cannot be cast to java.lang.String

Posted by Igor Vaynberg <ig...@gmail.com>.
textfield.settype(Long.class)

-igor

On Tue, Apr 7, 2009 at 4:15 PM, David Brown
<db...@sexingtechnologies.com> wrote:
> Hello Wicket dev, gurus and mortals, I was successfully using Wicket to build the UI for my new web-app gig. I have studied the javadoc: org.apache.wicket.markup.html.form, org.apache.wicket.MarkupContainer and others until bleary-eyed. The web-page I am using will display correctly the values for Long and Integer in a HTML text input dialog but when I try to Save (write the value back to the DB) I get the following error condition. I can only work with String data and nothing else using the wicket ids. Please advise, David.
>
> **************************************************************
> org.apache.wicket.WicketRuntimeException: Exception 'java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String' occurred during validation org.apache.wicket.validation.validator.StringValidator$MaximumLengthValidator on component 1:editform:weight     at org.apache.wicket.markup.html.form.FormComponent.validateValidators(FormComponent.java:1510)
>
> There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement).
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Wicket Noob: Long cannot be cast to java.lang.String

Posted by da...@davidwbrown.name.
I'm referring to the days of no JSP on AS400 boxes. The only option was to out.println() from a Servlet or some Serializable object a whole bunch of HTML and then do HTTP GET URL daisy-chain to another Servlet. ;-)


francisco treacy wrote ..
> Well, it was available 4 years ago :)
> 
> 
> 2009/4/9 David Brown <db...@sexingtechnologies.com>:
> > Hello Johan, thanks! the static NumberValidator.RangeValidator(long minimum,
> long maximum) worked! Wicket is great. I just wished Wicket was available 10 years
> ago! Regards, David.
> >
> > There are 10 kinds of people in this world: those who understand binary and those
> who don�t (Valid only for 2's complement).
> >
> > ----- Original Message -----
> > From: "Johan Compagner" <jc...@gmail.com>
> > To: users@wicket.apache.org
> > Sent: Tuesday, April 7, 2009 7:08:16 PM GMT -06:00 US/Canada Central
> > Subject: Re: Wicket Noob: Long cannot be cast to java.lang.String
> >
> > You seem to have a String validator on a number field. What do you
> > want to test a range? Or max value of that long? Use a different
> > validor
> >
> > On 08/04/2009, David Brown <db...@sexingtechnologies.com> wrote:
> >> Hello Wicket dev, gurus and mortals, I was successfully using Wicket to
> >> build the UI for my new web-app gig. I have studied the javadoc:
> >> org.apache.wicket.markup.html.form, org.apache.wicket.MarkupContainer and
> >> others until bleary-eyed. The web-page I am using will display correctly the
> >> values for Long and Integer in a HTML text input dialog but when I try to
> >> Save (write the value back to the DB) I get the following error condition. I
> >> can only work with String data and nothing else using the wicket ids. Please
> >> advise, David.
> >>
> >> **************************************************************
> >> org.apache.wicket.WicketRuntimeException: Exception
> >> 'java.lang.ClassCastException: java.lang.Long cannot be cast to
> >> java.lang.String' occurred during validation
> >> org.apache.wicket.validation.validator.StringValidator$MaximumLengthValidator
> >> on component 1:editform:weight � � at
> >> org.apache.wicket.markup.html.form.FormComponent.validateValidators(FormComponent.java:1510)
> >>
> >> There are 10 kinds of people in this world: those who understand binary and
> >> those who don�t (Valid only for 2's complement).
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket Noob: Long cannot be cast to java.lang.String

Posted by francisco treacy <fr...@gmail.com>.
Well, it was available 4 years ago :)


2009/4/9 David Brown <db...@sexingtechnologies.com>:
> Hello Johan, thanks! the static NumberValidator.RangeValidator(long minimum, long maximum) worked! Wicket is great. I just wished Wicket was available 10 years ago! Regards, David.
>
> There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement).
>
> ----- Original Message -----
> From: "Johan Compagner" <jc...@gmail.com>
> To: users@wicket.apache.org
> Sent: Tuesday, April 7, 2009 7:08:16 PM GMT -06:00 US/Canada Central
> Subject: Re: Wicket Noob: Long cannot be cast to java.lang.String
>
> You seem to have a String validator on a number field. What do you
> want to test a range? Or max value of that long? Use a different
> validor
>
> On 08/04/2009, David Brown <db...@sexingtechnologies.com> wrote:
>> Hello Wicket dev, gurus and mortals, I was successfully using Wicket to
>> build the UI for my new web-app gig. I have studied the javadoc:
>> org.apache.wicket.markup.html.form, org.apache.wicket.MarkupContainer and
>> others until bleary-eyed. The web-page I am using will display correctly the
>> values for Long and Integer in a HTML text input dialog but when I try to
>> Save (write the value back to the DB) I get the following error condition. I
>> can only work with String data and nothing else using the wicket ids. Please
>> advise, David.
>>
>> **************************************************************
>> org.apache.wicket.WicketRuntimeException: Exception
>> 'java.lang.ClassCastException: java.lang.Long cannot be cast to
>> java.lang.String' occurred during validation
>> org.apache.wicket.validation.validator.StringValidator$MaximumLengthValidator
>> on component 1:editform:weight     at
>> org.apache.wicket.markup.html.form.FormComponent.validateValidators(FormComponent.java:1510)
>>
>> There are 10 kinds of people in this world: those who understand binary and
>> those who don’t (Valid only for 2's complement).
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Wicket Noob: Long cannot be cast to java.lang.String

Posted by David Brown <db...@sexingtechnologies.com>.
Hello Johan, thanks! the static NumberValidator.RangeValidator(long minimum, long maximum) worked! Wicket is great. I just wished Wicket was available 10 years ago! Regards, David.

There are 10 kinds of people in this world: those who understand binary and those who don’t (Valid only for 2's complement).

----- Original Message -----
From: "Johan Compagner" <jc...@gmail.com>
To: users@wicket.apache.org
Sent: Tuesday, April 7, 2009 7:08:16 PM GMT -06:00 US/Canada Central
Subject: Re: Wicket Noob: Long cannot be cast to java.lang.String

You seem to have a String validator on a number field. What do you
want to test a range? Or max value of that long? Use a different
validor

On 08/04/2009, David Brown <db...@sexingtechnologies.com> wrote:
> Hello Wicket dev, gurus and mortals, I was successfully using Wicket to
> build the UI for my new web-app gig. I have studied the javadoc:
> org.apache.wicket.markup.html.form, org.apache.wicket.MarkupContainer and
> others until bleary-eyed. The web-page I am using will display correctly the
> values for Long and Integer in a HTML text input dialog but when I try to
> Save (write the value back to the DB) I get the following error condition. I
> can only work with String data and nothing else using the wicket ids. Please
> advise, David.
>
> **************************************************************
> org.apache.wicket.WicketRuntimeException: Exception
> 'java.lang.ClassCastException: java.lang.Long cannot be cast to
> java.lang.String' occurred during validation
> org.apache.wicket.validation.validator.StringValidator$MaximumLengthValidator
> on component 1:editform:weight     at
> org.apache.wicket.markup.html.form.FormComponent.validateValidators(FormComponent.java:1510)
>
> There are 10 kinds of people in this world: those who understand binary and
> those who don’t (Valid only for 2's complement).
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


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


Re: Wicket Noob: Long cannot be cast to java.lang.String

Posted by Johan Compagner <jc...@gmail.com>.
You seem to have a String validator on a number field. What do you
want to test a range? Or max value of that long? Use a different
validor

On 08/04/2009, David Brown <db...@sexingtechnologies.com> wrote:
> Hello Wicket dev, gurus and mortals, I was successfully using Wicket to
> build the UI for my new web-app gig. I have studied the javadoc:
> org.apache.wicket.markup.html.form, org.apache.wicket.MarkupContainer and
> others until bleary-eyed. The web-page I am using will display correctly the
> values for Long and Integer in a HTML text input dialog but when I try to
> Save (write the value back to the DB) I get the following error condition. I
> can only work with String data and nothing else using the wicket ids. Please
> advise, David.
>
> **************************************************************
> org.apache.wicket.WicketRuntimeException: Exception
> 'java.lang.ClassCastException: java.lang.Long cannot be cast to
> java.lang.String' occurred during validation
> org.apache.wicket.validation.validator.StringValidator$MaximumLengthValidator
> on component 1:editform:weight     at
> org.apache.wicket.markup.html.form.FormComponent.validateValidators(FormComponent.java:1510)
>
> There are 10 kinds of people in this world: those who understand binary and
> those who don’t (Valid only for 2's complement).
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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