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

Igor Vaynberg edited comment on WICKET-3866 at 7/21/11 5:59 AM:
----------------------------------------------------------------

there are a couple of problems with querying the model object for type - which 
is why we havent done it

a) most form components at some point start out with blank models - in which 
case this will not work. this is worse when things are reused and components 
work in some cases and not in others.

b) asking the model may result in an inaccurate type being resolved - eg we can 
resolve to a subclass of the type we want: textfield<number> may have a model 
object that is a long - which will resolve in a mismatch between generic and 
textfield type.

both of the reasons above hurt reuse because they are too inexact. sometimes 
its nicer to leave things more manual but easily traceable.

      was (Author: ivaynberg):
    there are a couple of problems with quering the model object for type - 
which is why we havent done it

a) most form components at some point start out with blank models - in which 
case this will not work. this is worse when things are reused and components 
work in some cases and not in others.

b) asking the model may result in an inaccurate type being resolved - eg we can 
resolve to a subclass of the type we want: textfield<number> may have a model 
object that is a long - which will resolve in a mismatch between generic and 
textfield type.

both of the reasons above hurt reuse because they are too inexact. sometimes 
its nicer to leave things more manual but easily traceable.
  
> Typecasted TextField ignores given Type
> ---------------------------------------
>
>                 Key: WICKET-3866
>                 URL: https://issues.apache.org/jira/browse/WICKET-3866
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.4.17, 1.5-RC5.1
>         Environment: Windows 7, JDK 1.6.0_26
>            Reporter: Paul
>            Assignee: Igor Vaynberg
>         Attachments: quickstart.zip, textFieldTypeInfer.txt
>
>
> Hi,
> while reading a Integer from a typecasted TextField I realised Wicket ignores 
> the given Type and asumes a String. Only way to get another Type is to call 
> the Function setType(). But using a typed contructor the usage of setType() 
> should be obsolete and the TextField should assume the given type.
> I attached a Quickstart. Simply have a look at the HomePage and comment out 
> Line 29.
> Cheers
> Paul

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to