smallufo
2018-06-16 07:29:37 UTC
After upgrading to 8.0 , I tried the exciting LambdaModel , try to replace
the non-TypeSafety PropertyModel
But I found it cannot handle type intelligently.
For a TextField<Integer> , for example :
form.add(new TextField<Integer>("year", LambdaModel.of(obj::getYear,
obj::setYear )));
At runtime , it reports Cannot cast from String to Integer.
I have to rewrite getter / setter to String type (and do conversion in
setter ) , but the backing field is Integer type. (And change
TextField<Integer> to TextField<String> , or <> )
This is pity ...
Did I miss anything ?
Thanks.
the non-TypeSafety PropertyModel
But I found it cannot handle type intelligently.
For a TextField<Integer> , for example :
form.add(new TextField<Integer>("year", LambdaModel.of(obj::getYear,
obj::setYear )));
At runtime , it reports Cannot cast from String to Integer.
I have to rewrite getter / setter to String type (and do conversion in
setter ) , but the backing field is Integer type. (And change
TextField<Integer> to TextField<String> , or <> )
This is pity ...
Did I miss anything ?
Thanks.