I have a page that takes a single argument. If this argument is NOT passed, then I would like to display an error message (“please pass argument ‘blah”) which will be shown in a FeedBackPanel and bail out. However, if I do not attach all the components, then wicket has an error instead, redirecting the client to Wicket’s error page.
Is there any way to display an error messages and NOT add all the items to a page? Some of the items are ListViews, etc…
If the a container is not visible, it’s not verified for structural consistency (matching childrens’ ids). So, just wrap your content in some container and call container.setVisible(false) if the parameter isn’t passed. You may then return immediately, without adding its children, Wicket won’t complain:
HomePage.java
HomePage.html