I have an Ajax event that triggers the redraw of various Wicket panels. Some panels have additional calculations of their own inside their onBeforeRender() method. If there is an error, I want to display it to the user. But I can't add the FeedbackPanel to the AjaxRequestTarget because I don't have access to it anymore inside the panel that is being redrawn.
Is there a way to get the AjaxRequestTarget inside onBeforeRender() of a Wicket component? Is it even possible to add additional components to the Ajax target once the first ones are already in onBeforeRender() state?
Is there a better way to add the FeedbackPanel to the Ajax target if only the panels that need to be redrawn can decide if there is an error or not?
onBeforeRender()
is a good idea. – PlayoffAjaxRequestTarget.get()
method back in Wicket 1.4 (seems to be gone in Wicket 6). However, as Robert already pointed out, validation logic and morevoer error reporting shouldn't be handled inonBeforeRender()
. – Smithers