简体   繁体   English

在wicket中,如何从面板中的ajax组件的onSubmit刷新反馈面板?

[英]In wicket, how can you refresh a feedbackpanel from an onSubmit of an ajax component within a panel?

I have a feedback panel at the top of my page. 我的页面顶部有一个反馈面板。

I have a number of panels, each have sub panels with AjaxFallback links that, when clicked I want to set info() messages to be displayed in the feedback panel. 我有许多面板,每个面板都有AjaxFallback链接的子面板,点击后我想设置info()消息显示在反馈面板中。

Do I have to pass my feedback panel down through the layers of panels in order that I can re-add it to the Ajax target when the link is clicked? 是否必须通过面板层向下传递我的反馈面板,以便在单击链接时可以将其重新添加到Ajax目标? Or is there another way? 或者还有另一种方式吗?

Thanks, Tom 谢谢,汤姆

以下在Wicket 6中有效

    target.addChildren(getPage(), FeedbackPanel.class);

Something has to add it to the target, but there are ways of using indirection so that things don't need to be passed around as much. 有些东西必须将它添加到目标,但有一些方法可以使用间接,这样就不需要传递任何东西了。 See this blog article for one tactic. 有关一种策略,请参阅此博客文章

Something similar is being added in Wicket 1.5. 在Wicket 1.5中添加了类似的东西。 See WICKET-1312 for bug-tracking about this addition. 有关此添加的错误跟踪,请参阅WICKET-1312

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM