使用AJAX按钮单击事件后重新加载wicket组件

问题描述 投票:0回答:1

我在这里使用wicket组件。我的观点如下。

enter image description here

我需要重新生成报告并使用按钮单击(GO)重新加载报告框架。但是,即使用一个新的报表元素替换旧元素,这个div也没有重新加载。谁能帮我这个?

form.add(new AjaxLink<Void>("goLink") {
        @Override
        public void onClick(final AjaxRequestTarget target) {
            System.out.println(reportType+"go button clicked");
            final IResourceStream stream = renderItems();
            //generate report and create a new component using that.
            Component component = new AIAIframe("reportFrame", stream);
            component.setOutputMarkupId(true);
            this.addOrReplace(component);
            System.out.println("new framwe added reportframe");
        }
    });
    add(form);

请在下面找到markup.html

<wicket:extend>
<div style="margin-left:3%;">
    <form wicket:id="form">
        <span>
            <h4>Report Erscheinung Auswahl</h4>

            <select wicket:id="chooseType" style="margin-left:5%;">
            <option>Kostenvoranschlag</option>
            <option>Aufträge</option>
            <option>Rechnungen</option>
        </select>
        </span>
        <span>
            <a href="#" class="downloadLink" wicket:id="goLink">GO</a>
        </span>
    </form>
</div>
<br>
<style>
    a.downloadLink {
      width: 115px;
      height: 25px;
      background: #4E9CAF;
      padding: 6px;
      text-align: center;
      border-radius: 5px;
      color: white;
      font-weight: bold;
    }
    .aia-center {
       margin:0 auto;
       padding: 6px;
    }
</style>
<div class="aia-center">
    <span>Download as: </span>
    <select wicket:id="formatSelect">
    </select>
    <a href="#" class="downloadLink" wicket:id="downloadLink">Download</a>
</div>
<span style="height: 100%; width: 100%" wicket:id="reportFrame"></span>

java html ajax wicket reload
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.