[Wicket-user] Conversion Error For Boolean/Checkbox

2007-01-17 Thread Ayodeji Aladejebi

Please when I used the SignInForm RemeberMe property, anytime a user checks
it, i keep getting this error

Caused by: java.util.MissingResourceException: Unable to find resource:
ConversionError for component:
registerPanel:signInForm:rememberMeRow:rememberMe
   at wicket.Localizer.getString(Localizer.java:262)
   at wicket.Localizer.getString(Localizer.java:121)
   at wicket.markup.html.form.FormComponent.error(FormComponent.java
:398)
   at wicket.markup.html.form.FormComponent.convert(FormComponent.java
:907)

even though a boolean property exists properly mapped to the model.

any help?
thanks
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Conversion Error For Boolean/Checkbox

2007-01-17 Thread Ayodeji Aladejebi

Version: 1.2.4

On 1/17/07, Ayodeji Aladejebi [EMAIL PROTECTED] wrote:


Please when I used the SignInForm RemeberMe property, anytime a user
checks it, i keep getting this error

Caused by: java.util.MissingResourceException: Unable to find resource:
ConversionError for component:
registerPanel:signInForm:rememberMeRow:rememberMe
at wicket.Localizer.getString(Localizer.java:262)
at wicket.Localizer.getString(Localizer.java:121)
at wicket.markup.html.form.FormComponent.error(FormComponent.java
:398)
at wicket.markup.html.form.FormComponent.convert (
FormComponent.java:907)

even though a boolean property exists properly mapped to the model.

any help?
thanks



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Conversion Error For Boolean/Checkbox

2007-01-17 Thread Arnout Engelen
Ayodeji Aladejebi schreef:
 Please when I used the SignInForm RemeberMe property, anytime a user 
 checks it, i keep getting this error

 Caused by: java.util.MissingResourceException: Unable to find 
 resource: ConversionError for component: 
 registerPanel:signInForm:rememberMeRow:rememberMe
 at wicket.Localizer.getString(Localizer.java:262)
 at wicket.Localizer.getString(Localizer.java:121)
 at 
 wicket.markup.html.form.FormComponent.error(FormComponent.java:398)
 at wicket.markup.html.form.FormComponent.convert 
 (FormComponent.java:907)

 even though a boolean property exists properly mapped to the model.

I seem to remember having some problems when the checkbox had a 'value' 
attribute in the HTML (i.e. value='checkbox'). Might be worth a look?


Arnout

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Conversion Error For Boolean/Checkbox

2007-01-17 Thread Ayodeji Aladejebi

waoh...behold the wonder of this day..thanks for that tip..works fine now

On 1/17/07, Arnout Engelen [EMAIL PROTECTED] wrote:


Ayodeji Aladejebi schreef:
 Please when I used the SignInForm RemeberMe property, anytime a user
 checks it, i keep getting this error

 Caused by: java.util.MissingResourceException: Unable to find
 resource: ConversionError for component:
 registerPanel:signInForm:rememberMeRow:rememberMe
 at wicket.Localizer.getString(Localizer.java:262)
 at wicket.Localizer.getString(Localizer.java:121)
 at
 wicket.markup.html.form.FormComponent.error(FormComponent.java:398)
 at wicket.markup.html.form.FormComponent.convert
 (FormComponent.java:907)

 even though a boolean property exists properly mapped to the model.

I seem to remember having some problems when the checkbox had a 'value'
attribute in the HTML (i.e. value='checkbox'). Might be worth a look?


Arnout

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] conversion

2006-05-10 Thread Johan Compagner
we try to do it:if (object instanceof String)   {// and that String is not emptyfinal String string = (String)object;if (!Strings.isEmpty(string))
{ // and there is a non-null property type for the component final Class propertyType = propertyType(component); if (propertyType != null)
 {  // convert the String to the right type  object = component.getConverter().convert(string, propertyType); }}
   }   PropertyResolver.setValue(_expression_, modelObject, object, component==null ? null:component.getConverter());But if you use a compound/propertymodel as the texfields own root model then the component isn't there
so the Session will be used.Why don't you se the right type on the textfields? That is the prefered way because the error is catched much earlierand validators can work on the right object.
On 5/10/06, Ittay Dror [EMAIL PROTECTED] wrote:
i created a TextField, without setting its type, but with overriding of getConverter(), i also used a CompoundPropertyModelwhat happened is that this converter was not used in convert(), but was used by the property resolver. inside the PropertyResolver code, it threw an exception, which, was rethrown as InvocationException, which was considered unexpected, and so the page was redirected to the error page (rather than showing a conversion error)
ittay--===Ittay DrorChief architect, openQRM TL,RD, Qlusters Inc.[EMAIL PROTECTED]+972-3-6081994 Fax: +972-3-6081841
http://www.openQRM.org- Keeps your Data-Center Up and Running---Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] conversion

2006-05-10 Thread Eelco Hillenius

Yeah, I'm not totally crazy about that either. But the fact that we
only try to convert when there is a converter set comes from:
* some components, like CheckBox use their own kind of conversion, and
thus override the convertValue method
* some users strongly objected against Wicket always trying to use
converters. In older Wicket versions, it was integrated in it's
adoption of OGNL. But users wanted less magic.

Eelco


On 5/10/06, Ittay Dror [EMAIL PROTECTED] wrote:

i created a TextField, without setting its type, but with overriding of 
getConverter(), i also used a CompoundPropertyModel

what happened is that this converter was not used in convert(), but was used by 
the property resolver. inside the PropertyResolver code, it threw an exception, 
which, was rethrown as InvocationException, which was considered unexpected, 
and so the page was redirected to the error page (rather than showing a 
conversion error)

ittay

--
===
Ittay Dror
Chief architect, openQRM TL,
RD, Qlusters Inc.
[EMAIL PROTECTED]
+972-3-6081994 Fax: +972-3-6081841

http://www.openQRM.org
- Keeps your Data-Center Up and Running


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] conversion

2006-05-10 Thread Johan Compagner
I guess you mean only try to convert when there is a type set ?Checkbox is abit of a bad example, A DropDown or anohter Choice is a better oneConverter is Type conversion String to Date or Integer or what ever.
But convertValue (used in the Choice classes) is not type conversionBut it is more a Lookup conversion (or how do i say this better)The input/request value is an id and for that id a object is lookupped..
The normal converter can never do that. Because it doesn't have any context (The Choices List and the IChoiceRenderer in this case)But as i said we always try to use the converter of the component.But for this particulair case we don't have the component.
Maybe we should have a getRootObject(Component) and setRootObject(Component) methodsin the ICompoundModel interface, So that we can give the component to the model.johan
On 5/10/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
Yeah, I'm not totally crazy about that either. But the fact that weonly try to convert when there is a converter set comes from:* some components, like CheckBox use their own kind of conversion, andthus override the convertValue method
* some users strongly objected against Wicket always trying to useconverters. In older Wicket versions, it was integrated in it'sadoption of OGNL. But users wanted less magic.EelcoOn 5/10/06, Ittay Dror 
[EMAIL PROTECTED] wrote: i created a TextField, without setting its type, but with overriding of getConverter(), i also used a CompoundPropertyModel what happened is that this converter was not used in convert(), but was used by the property resolver. inside the PropertyResolver code, it threw an exception, which, was rethrown as InvocationException, which was considered unexpected, and so the page was redirected to the error page (rather than showing a conversion error)
 ittay -- === Ittay Dror Chief architect, openQRM TL, RD, Qlusters Inc. [EMAIL PROTECTED]
 +972-3-6081994 Fax: +972-3-6081841 http://www.openQRM.org - Keeps your Data-Center Up and Running ---
 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1
 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user---Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimohttp://sel.as-us.falkag.net/sel?cmdlnkkid0709bid3057dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] conversion

2006-05-10 Thread Ittay Dror

yes, after i saw the exception, and looked at the code to find the exact 
reason, i added the type

Johan Compagner wrote:

we try to do it:

if (object instanceof String)
{
// and that String is not empty
final String string = (String)object;
if (!Strings.isEmpty(string))
{
// and there is a non-null property type for the 
component

final Class propertyType = propertyType(component);
if (propertyType != null)
{
// convert the String to the right type
object = 
component.getConverter().convert(string, propertyType);

}
}
}

PropertyResolver.setValue(expression, modelObject, object, 
component==null ? null:component.getConverter());


But if you use a compound/propertymodel as the texfields own root model 
then the component isn't there

so the Session will be used.

Why don't you se the right type on the textfields? That is the prefered 
way because the error is catched much earlier

and validators can work on the right object.



On 5/10/06, *Ittay Dror* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


i created a TextField, without setting its type, but with overriding
of getConverter(), i also used a CompoundPropertyModel

what happened is that this converter was not used in convert(), but
was used by the property resolver. inside the PropertyResolver code,
it threw an exception, which, was rethrown as InvocationException,
which was considered unexpected, and so the page was redirected to
the error page (rather than showing a conversion error)

ittay

--
===
Ittay Dror
Chief architect, openQRM TL,
RD, Qlusters Inc.
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
+972-3-6081994 Fax: +972-3-6081841

http://www.openQRM.org
- Keeps your Data-Center Up and Running


---
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your
job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
mailto:Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





--
===
Ittay Dror 
Chief architect, openQRM TL, 
RD, Qlusters Inc.

[EMAIL PROTECTED]
+972-3-6081994 Fax: +972-3-6081841

http://www.openQRM.org
- Keeps your Data-Center Up and Running


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user