How to get the AjaxRequestTarget inside Wicket's onBeforeRender() method of a component?

后端 未结 1 1638
眼角桃花
眼角桃花 2021-02-09 07:55

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 a

相关标签:
1条回答
  • 2021-02-09 08:15

    Getting the AjaxTarget is done like this:

    AjaxRequestTarget target = requestCycle.find(AjaxRequestTarget.class);
    

    Unfortunately, like expected, I can't add components to the target once I'm in the rendering phase. But Wicket provides the interface ITargetRespondListener with the method onTargetRespond(AjaxRequestTarget target). Here I can add anything I want to the target.

    0 讨论(0)
提交回复
热议问题