No, why? Wicket should react by checking for nulls and not failing.
Person p = (Person)getModelObject(); won't fail if it's null. Any
PropertyModel should just return null if the 'master' property is
null.

Why is that so strange? And what does it have to do with parsing
request parameters? I find it perfectly natural that the 'name'
property of a null object gets me null when working with Ognl. In
fact, that's another good reason to support this; all expression
languages like Ognl, but also JSF's and for example Velocity's allows
you to have expression where somewhere in the path is a null. The end
result is just null.

Eelco


On 8/24/05, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> How should Wicket react to this?
> 
> public MyPage() {
>    add(new MyForm("form", new CompoundPropertyModel(null)));
> }
> 
> public class MyForm extends Form {
>    public MyForm(String id, IModel model) {
>        super(id, model);
>        add(new TextField("name"));
>    }
> }
> 
> This is what you propose... How should Wicket on submission populate the
> name field? How can we 'decide' that this is a Person object?
> If you go this way, then you are back in parsing request parameters by
> hand again... Go Struts!
> 
> Martijn
> 
> 
> Eelco Hillenius wrote:
> 
> >Unfortunately, I don't own an Apple. Martijn does though :)
> >
> >I don't agree with Martijn actually. Like I said, we have had
> >developer discussions about this before. I think we should allow nulls
> >in all our models. I can't see anything wrong with that. Just an
> >'empty' case. And even if we decided (like it seems we did) that nulls
> >are not allowed, we should /fail fast/ instead of not until the actual
> >model object is requested. And as that is not something that is
> >possible at construction time a lot of times, I think we should make
> >sure we allow nulls.
> >
> >Eelco
> >
> >
> >-------------------------------------------------------
> >SF.Net email is Sponsored by the Better Software Conference & EXPO
> >September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> >Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> >Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> >_______________________________________________
> >Wicket-user mailing list
> >Wicket-user@lists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to