本文介绍了组件是转发器,不能直接通过ajax进行重绘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了包含2个文本框的列表视图
&我想将其填充在ajaxbutton提交上.
但我收到此错误:

I created List view which contain 2 textboxes
& i want to fill those on ajaxbutton submit.
but I am getting this error:

推荐答案

您应该使用WebMarkupContainer包围列表视图,并将此标记容器添加到请求目标.

You should surround your list view with a WebMarkupContainer and add this markup container to the request target.

html代码:


<div wicket:id="wmc">
    ...
    put your list view here
    ...
</div>

java代码

final WebMarkupContainer wmc = new WebMarkupContainer("wmc");
add(wmc);
ListView yourListView = ...
// init your list view here
wmc.add(yourListView);

SubmitButton yourButton = new SubmitButton("yourButton") {
    @Override
    public void onSubmit(AjaxRequestTarget target) {
        target.add(wmc);
    }
}
add(yourButton);

这篇关于组件是转发器,不能直接通过ajax进行重绘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 01:57