You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2010/11/15 01:40:17 UTC

[jira] Commented: (WICKET-1568) contribution for wicket 1.5 generics (IConverter)

    [ https://issues.apache.org/jira/browse/WICKET-1568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931942#action_12931942 ] 

Hudson commented on WICKET-1568:
--------------------------------

Integrated in Apache Wicket 1.5.x #516 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/516/])
    

> contribution for wicket 1.5 generics (IConverter)
> -------------------------------------------------
>
>                 Key: WICKET-1568
>                 URL: https://issues.apache.org/jira/browse/WICKET-1568
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4-M1, 1.5-M3
>            Reporter: Peter Ertl
>            Assignee: Martin Grigorov
>             Fix For: 1.4-M2, 1.5-M4
>
>         Attachments: converter.patch, WICKET-1568.patch
>
>
> I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses
> ----------------------
> public class MyMoneyTextField extends TextField<BigDecimal>
> {
>   public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
>   {
>     super(id, model);
>   }
>   // ...
>   
>   @Override
>   public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
>   {
>     // no ugly casts here anymore :-)
>     //
>     return new IConverter<BigDecimal>()
>     {
>       public BigDecimal convertToObject(final String value, final Locale locale)
>       {
>         // ...
>       }
>       public String convertToString(final BigDecimal value, final Locale locale)
>       {
>         // ...
>       }
>     };
>   }
> }
> I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.
> Best regards
> Peter

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