wicket 向导中的 GridView 无法呈现错误反馈消息 [英] A GridView inside a Wizard in wicket fails to render error feedback messages
问题描述
我有一个自定义向导,定义如下:
<div><form wicket:id="form" class="wizard"><span class="wizardoverview" wicket:id="overview"/><div class="wizardheader" wicket:id="header"/><div wicket:id="view" class="wizardpage"/><span wicket:id="feedback"/><div class="buttons"><span wicket:id="buttons"/>
</表单>
</wicket:panel>
在这种情况下,向导页面是一个具有自己形式的面板.这个表单包含一个新的 Panel,它又包含一个 GridView.GridView 包含一组面板,每个面板包含一个 FormComponentFeedbackBorder,后者又包含输入 TextField.
呸!
所以我们有这个:
Wizard->WizardpagePanel->Form->GridContainingPanel->GridView->Panel[]->FormComponentFeedbackBorder->TextField
当 TextField 验证失败时,根本不会呈现任何反馈.如果我向 GridContainingPanel 添加一个 FeedbackPanel,则会呈现错误消息,但 FormComponentFeedbackBorder 什么都不呈现.
任何关于可能出错的提示?
我遇到了类似的问题,使用 ListView 而不是 GridView,但是当我设置 listView.setReuseItems(true); 时,这个问题得到了解决;
GridView 有没有类似的设置,或者这个问题有什么不同的解决方案?
就是这样:
gridView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
解决了问题.
谢谢,rotsch.
I have a custom Wizard, defined as follows:
<wicket:panel>
<div>
<form wicket:id="form" class="wizard">
<span class="wizardoverview" wicket:id="overview"/>
<div class="wizardheader" wicket:id="header"/>
<div wicket:id="view" class="wizardpage"/>
<span wicket:id="feedback"/>
<div class="buttons">
<span wicket:id="buttons"/>
</div>
</form>
</div>
</wicket:panel>
The wizardpage is in this case a Panel with its own form. This form contains a new Panel, which in turn contains a GridView. The GridView contains a set of Panels, which each contain a FormComponentFeedbackBorder, which in turn contains input TextFields.
Phew!
So we have this:
Wizard->WizardpagePanel->Form->GridContainingPanel->GridView->Panel[]->FormComponentFeedbackBorder->TextField
When TextField fails validation, no feedback is rendered at all. If I add a FeedbackPanel to the GridContainingPanel the error messages are rendered, but FormComponentFeedbackBorder renders nothing.
Any pointers as to what can be wrong?
I had a similar problem with a ListView instead of GridView, but that problem was resolved when I set listView.setReuseItems(true);
Is there a similar setting for GridView, or is there a different solution to this problem?
That was it:
gridView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
solved the problem.
Thanks, rotsch.
这篇关于wicket 向导中的 GridView 无法呈现错误反馈消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!