> Let's say you encounter an error halfway through the constructor of a
> page,
> and you want to display error("error message") and then return without
> processing rest of components?  It doesn't seem like this is possible
> in
> wicket because it makes you fill in all components or else it barfs.
> Am I wrong, or is there a way to do this in wicket?

1) Ideally, a constructor does NOTHING other than
   - validate arguments, and throw necessary exception if they are wrong
   - set properties (no side-effects) that will be used by other "business" 
methods later

In Wicket, Swing etc., the latter also covers setting up component hierarchies. 
So actual errors should only appear later, e.g. as a consequence of a LDM 
failing to connect to a database at render time.

2) If that is not an option, the way to interrupt a constructor is the same way 
as for any other method, throw and exception. For instance a 
WicketRuntimeException.

- Tor Iver


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to