Re: [Wicket-user] Re: AbstractConverter

2005-04-22 Thread Eelco Hillenius
That's not a bug. Caused by: java.util.MissingResourceException: Unable to find resource: form.email.TypeValidator at wicket.Localizer.getString(Localizer.java:147) means Wicket can't find resource with key 'form.email.TypeValidator'. By default Wicket throws an exception when it can't find

Re: [Wicket-user] Re: AbstractConverter

2005-04-21 Thread Eelco Hillenius
Personally, I expected the Compound/BoundCompoundPropertyModels to behave excactly the same, as they solve the same problem/ do the same magic (operate with Ognl on a 'target' object). Conceptually, the only difference between those two classes and PropertyModel is that the Compound models

Re: [Wicket-user] Re: AbstractConverter

2005-04-21 Thread Jonathan Locke
yup. makes sense to me. i think it's important to keep at least an implementation distinction between compound/boundcompound in terms of the records that are kept of the Binding internally. we should have a mode (as currently exists in compound) where the binding doesn't cost anything because

Re: [Wicket-user] Re: AbstractConverter

2005-04-21 Thread Gili
Good catch, thanks! Here is why it was so confusing. The exception we see is: ognl.OgnlException: email [java.lang.ClassCastException: [Ljavax.mail.internet.InternetAddress;] The thing that confused me was [] around the class name, but upon closer inspection the closing ] is

Re: [Wicket-user] Re: AbstractConverter

2005-04-21 Thread Gili
I found a bug in Wicket's handling of newConversionException(). Here's my updated source-code: /* * Page.java * * Created on March 10, 2005, 5:23 PM */ package com.be.desktopbeautifier.web.mailinglist; import java.util.Date; import java.util.Locale; import java.util.Properties; import

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Gili
I'd like to discuss this issue online with one of you, preferrably over MSN, AOL, or Yahoo messenger. I am using BoundCompoundPropertyModel so if I understand you correctly then the conversion should be automatic. I provided my own converter, which I register using: Converter converter =

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Eelco Hillenius
Could you send us your converter? I think it is a good idea to keep this discussion on the list, so that other (future) users can also follow it. Eelco Gili wrote: I'd like to discuss this issue online with one of you, preferrably over MSN, AOL, or Yahoo messenger. I am using

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Eelco Hillenius
Let's extend the form example in wicket-examples with a custom converter. I think your InternetAddressConverter could make a nice example, right? Eelco Gili wrote: I'd like to discuss this issue online with one of you, preferrably over MSN, AOL, or Yahoo messenger. I am using

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Gili
Here is the entire file. /* * Page.java * * Created on March 10, 2005, 5:23 PM */ package com.be.desktopbeautifier.web.mailinglist; import java.util.Date; import java.util.Locale; import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Gili
Sounds good to me. I'm more than happy to contribute it. Gili Eelco Hillenius wrote: Let's extend the form example in wicket-examples with a custom converter. I think your InternetAddressConverter could make a nice example, right? Eelco Gili wrote: I'd like to discuss this issue online

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Eelco Hillenius
Ah, I just found out that InternetAddress is part of the java mail package. I'll use URL instead; the trick is still the same. Btw, you're a NetBeans user if I remember right... Is the build.xml we put in our projects in your way? I'm playing with NetBeans a bit myself here. Eelco Gili wrote:

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Gili
I use the Netbeans 4.2 nightly builds. What do you mean is the build.xml ... in your way? Meaning, am I using it for my projects? No, I built my own project files. Yeah, try using URL instead of InternetAddress. I am curious whether you are able to reproduce the same problem on your end.

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Eelco Hillenius
So, if you would check out wicket from cvs, you would delete the build.xml file, so that can let NetBeans create a new project. If you don't delete it, NetBeans will complain that there allready is an ant script, and that it can't put it's project there (using new ... with existing sources).

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Gili
Create a new project in a new directory. Don't try creating a project into a preexisting directory that already contains builds.xml. In my case, I create directories named Netbeans41 or Netbeans42 etc... Gili Eelco Hillenius wrote: So, if you would check out wicket from cvs, you would

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Eelco Hillenius
Here's my first remark: instead of: catch (AddressException e) { throw new IllegalArgumentException(e); } do: catch (AddressException e) { throw newConversionException(' + value + ' is not a valid URL, value, null); } or anything else that throws a

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Gili
Will do, thanks! Gili Eelco Hillenius wrote: Here's my first remark: instead of: catch (AddressException e) { throw new IllegalArgumentException(e); } do: catch (AddressException e) { throw newConversionException(' + value + ' is not a valid URL, value,

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Eelco Hillenius
I just implemented URL converter here, and it works without problems... I still don't know what your problem is now. Anyway, I'll make the example a bit nicer and commit it later. Could you see whether your problem still exists in HEAD, and, if so, whether you have the same problems if you use

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Eelco Hillenius
Yeah, found a problem when I stepped all the way through... In CompoundPropertyModel: protected Class propertyType(final Component component) { return null; } This can't be right... Unfortunately, I'm out of time here. But I'll file a bug, and check in my examples code. To be

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Gili
Good catch! I'll wait on the bugfix, hopefully it'll solve the problem. Gili Eelco Hillenius wrote: Yeah, found a problem when I stepped all the way through... In CompoundPropertyModel: protected Class propertyType(final Component component) { return null; } This can't be

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Eelco Hillenius
Not sure yet if it is your bug as well, but at least we're on to something. Eelco Gili wrote: Good catch! I'll wait on the bugfix, hopefully it'll solve the problem. Gili Eelco Hillenius wrote: Yeah, found a problem when I stepped all the way through... In CompoundPropertyModel: protected

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Jonathan Locke
the assumption here was that OGNL would convert in this case and that boundcompoundpropertymodel would be used for explicit type conversions. this design is not necessarily wrong, but it might be better from the user's point of view to do some model reflection here instead... Eelco Hillenius

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Jonathan Locke
not quite a bug because it was designed this way, but if you were expecting converters to work magically, with compoundpropertymodels, this is a design misfeature. the easy workaround is to use the bound compound model, which lets you specify propertyType best, jon Eelco Hillenius wrote:

Re: [Wicket-user] Re: AbstractConverter

2005-04-20 Thread Gili
If you look at my code (previous email) you will notice that I am using a BoundCompoundPropertyModel and binding the InternetAddress type to the email component. In other words, this should already be working. Gili Jonathan Locke wrote: not quite a bug because it was designed this way, but if

[Wicket-user] Re: AbstractConverter

2005-04-19 Thread Gili
Ok, I've defined convert() and added my converter to the default one but now I get this exception: ognl.OgnlException: email [java.lang.ClassCastException: [Ljavax.mail.internet.InternetAddress;] at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:84) at

Re: [Wicket-user] Re: AbstractConverter

2005-04-19 Thread Eelco Hillenius
I don't know what your problem is; I need more code. Anyway, here are a few hints for working with converters in general: - be sure conversion works two ways. Generally you have to have a converter for get- and one for setObject; - conversion is only automatic when you use the PropertyModels