Yes , I know...
But I hope it will be more informative.
Because in practice , there may be lots of models , nested panels , forms
, even in one page...
Informative error message can make us quickly understand which model needs
to implement setObject.
(just like the un-serializable field error message)

Thanks.


Francois Meillet <francois.meil...@gmail.com> 於 2020年5月30日 週六 下午9:58寫道:

> Hi,
>
> Depending on the model you use, you may need to ovveride the setObject()
> method.
>
> from the API docs
>
> default void setObject​(T object)
>
> Throws:
> UnsupportedOperationException - unless overridden
>
>
>
> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
> <
> https://ci.apache.org/projects/wicket/apidocs/9.x/org/apache/wicket/model/IModel.html#setObject(T)
> >
>
>
> François
>
>
>
> > Le 30 mai 2020 à 15:46, smallufo <small...@gmail.com> a écrit :
> >
> > Hi
> > I am building an app with complicated forms , nested models ...
> > Some times it obsesses me is the UnsupportedOperationException :
> >
> > java.lang.UnsupportedOperationException: Override this method to support
> > setObject(Object)
> >
> > at org.apache.wicket.model.IModel.setObject(IModel.java:84)
> > It doesn't pinpoint me which model , which form , which panel...
> > very hard to debug...
> > For non-serializable exception , it can provide meaning information ,
> even
> > pinpoint which field causes the problem.
> > I hope some day , this UnsupportedOperationException can also be so
> > informative.
> >
> > Thanks.
>
>

Reply via email to