Should we expect empty PageParameters for pages that have such a constructor yet no parameters are available?

2014-01-15 Thread Paul Bors
Suppose I have a page with the default constructor and with the page parameter constructor. Should my page parameter constructor be called with an empty not null PageParameter instance when no parameters are provided? Shouldn't the default constructor be used instead? What about in unit tests?

Re: Should we expect empty PageParameters for pages that have such a constructor yet no parameters are available?

2014-01-15 Thread Paul Bors
Btw, I just noticed that adding this constructor eliminates the problem: public MyPage() { this(null); } So I take it Wicket tries to build the page via the Page(PageParameters) but instead of using a null reference to the PageParameters it builds an object without any parameters in it. If

Re: Should we expect empty PageParameters for pages that have such a constructor yet no parameters are available?

2014-01-15 Thread Martin Grigorov
AFAIR if there are no request parameters then Wicket first uses the Java default constructor (no parameters) if available. If there is no such constructor then Wicket constructs an empty PageParameters and uses it for the constructor with PageParameters. If none are available then an error is

Re: Should we expect empty PageParameters for pages that have such a constructor yet no parameters are available?

2014-01-15 Thread Paul Bors
Awsome, thanks! One last question, in my tests I keep a collection of page parameters for my pages. I've noticed at some point wicket tester (or deeper in the framework, prob. in the page factory) that the PageParameter instance used had the parameters combined from different instances. That

Re: Should we expect empty PageParameters for pages that have such a constructor yet no parameters are available?

2014-01-15 Thread Martin Grigorov
On Thu, Jan 16, 2014 at 12:07 AM, Paul Bors p...@bors.ws wrote: Awsome, thanks! One last question, in my tests I keep a collection of page parameters for my pages. I've noticed at some point wicket tester (or deeper in the framework, prob. in the page factory) that the PageParameter