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
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
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
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
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
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 =
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
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
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
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
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:
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.
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).
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
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
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,
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
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
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
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
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
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:
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
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
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
25 matches
Mail list logo