A GridView inside a Wizard in wicket fails to render error feedback messages

旧时模样 提交于 2019-12-13 07:15:26

问题


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?


回答1:


That was it:

gridView.setItemReuseStrategy(new ReuseIfModelsEqualStrategy()); 

solved the problem.

Thanks, rotsch.



来源:https://stackoverflow.com/questions/8080935/a-gridview-inside-a-wizard-in-wicket-fails-to-render-error-feedback-messages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!