You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Eelco Hillenius (JIRA)" <ji...@apache.org> on 2007/05/03 17:30:15 UTC

[jira] Assigned: (WICKET-525) Component.getConverter is ignored by PropertyConverter

     [ https://issues.apache.org/jira/browse/WICKET-525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eelco Hillenius reassigned WICKET-525:
--------------------------------------

    Assignee: Matej Knopp

We've been talking about creating our text components smarter so that they can get the target types from the models.

> Component.getConverter is ignored by PropertyConverter
> ------------------------------------------------------
>
>                 Key: WICKET-525
>                 URL: https://issues.apache.org/jira/browse/WICKET-525
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3
>         Environment: jdk1.4 wicket-1.3.0-incubating-beta1
>            Reporter: Ivlev Dmitry
>         Assigned To: Matej Knopp
>            Priority: Minor
>             Fix For: 1.3
>
>
> I have a FormComponent with custom Converter:
> item.setModel(new CompoundPropertyModel(data));
> final TextField quantityField = new TextField("quantity") {
>   public IConverter getConverter(Class aClass) {
>     return Converters.QUANTITY;
>   }
> };
> item.add(quantityField );
> but when form submitted my QUANTITY converter wasn't used for converting right value.
> PropertyResolver uses PropertyResolverConverter with current session converter implementation and ignores custom converter:
> org.apache.wicket.util.convert.ConversionException: Cannot parse '3.2' using format java.text.DecimalFormat@674dc     at org.apache.wicket.util.convert.converters.AbstractConverter.newConversionException(AbstractConverter.java:74)     at org.apache.wicket.util.convert.converters.AbstractConverter.parse(AbstractConverter.java:54)     at org.apache.wicket.util.convert.converters.AbstractNumberConverter.parse(AbstractNumberConverter.java:71)     at org.apache.wicket.util.convert.converters.DoubleConverter.convertToObject(DoubleConverter.java:44)     at org.apache.wicket.util.lang.PropertyResolverConverter.convert(PropertyResolverConverter.java:67)     at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:839)     at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:458)     at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:133)     at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:152)     at org.apache.wicket.Component.setModelObject(Component.java:2061)     at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:724)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.