this constructor can be deleted yes:

public TextField(final String id, final Class type)
   {
       super(id);
       setType(type);
   }


but i don't know about this one:

   public TextField(final String id, IModel model, Class type)
   {
       super(id, model);
       setType(type);
   }

because if you don't use the propertymodel here then that type is pretty
needed
And bigger problem here, if you override
public IConverter getConverter(Class type)
and you don't set the type then that converter isn't used.

but this is also pure for models that don't use our own property model
variants
because we always set the type then (IObjectClassAwareModel)

johan


On 7/10/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:

Matej had the brilliant idea of auto discovery of the type parameter
for FormComponents when they use a PropertyModel or
CompoundPropertyModel. In order to remove confusion for noobs, and to
point out that there is a Better Way (tm) I propose the following
options:

For those wondering if it is still possible to set the target type:
yes you can, just use the setType() method on the form component.

I know it is a tad late in the game, but I think the clean up is
something worthwile.

[ ] remove the affected FormComponent constructors with the type parameter
[ ] deprecate the affected FormComponent constructors with the type
parameter
[ ] leave them

Martijn

--
Wicket joins the Apache Software Foundation as Apache Wicket
Apache Wicket 1.3.0-beta2 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta2/

Reply via email to