Hi Tron,

Would it not suffice to change PropertyColumn to implement IExportableColumn<T, S, ? extends Object>? This would make the return type of getDataModel() a IModel<? extends Object>, and IModel<String> will work.

Alternative is in Wicket 7, remove third type parameter for IExportableColumn, and make getDataModel() return IModel<?>. Downside of this is that you can never getDataModel().setObject(), but I dont think anyone does that anyways.

Cheers,
Jesse

On 13/03/2013 11:39, Tron Walseth wrote:
Hi

A bit of advice is needed;

The method createDataLabel of 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn is deprecated 
since 6.2.0, and the documentation advice is to use public IModel<Object> 
getDataModel(IModel<T> rowModel) instead.

We have overridden this method in some places, and in most cases, the method returns 
a ResourceModel (IModel<String>). When fixing deprecation warnings by changing 
the method name, the compiler complains that the return type is not correct.

The solution is fairly simple, just change the signature to
             @SuppressWarnings({ "rawtypes", "unchecked" })
             @Override
             public IModel getDataModel(final IModel<T> rowModel){....}

and everything works, but I don't like this solution. This is (in my book) not 
clean code.

I would like to know, is there anybody that have a better solution, and if not, is it 
possible to change the return value of getDataModel to IModel<?> ?

Yours
Tron
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to