Wicket:如果我想在DataTable中显示20k记录,IE 10会“无响应”

时间:2015-03-19 12:56:07

标签: java datatable wicket

当用户从"用户列表"的下拉列表中点击"全部"(20k)时,Internet Explorer 10属于"无响应"州。 如果用户忽略了"没有回复"状态并保持等待,大约4分钟后显示完整报告。 在Firefox 26(支持)和Chrome 32(不支持)上尝试此过程,我不会遇到它。 如何提高性能AjaxFallbackDefaultDataTable?

 private WebMarkupContainer createReportContainer()
    {
        Collections.addAll(numberRowsList, "50", "100", "1000", "All");

        final WebMarkupContainer usersDiv = new WebMarkupContainer("usersDiv");

        usersDropDown = new NoDefaultDropDownChoice<String>("usersDropdown", new Model<String>(String.valueOf(DEFAULT_ROWS_PER_PAGE)), numnerRowsList);
        usersDropDown.add(new AjaxFormComponentUpdatingBehavior("onchange")
        {
            private static final long serialVersionUID = 1L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target)
            {
                final int index = Integer.valueOf(usersDropDown.getValue());
                try
                {
                    rowsPerPage = Integer.valueOf(numberRowsList.get(index));
                }
                catch (final NumberFormatException ex)
                {
                    rowsPerPage = usersTable.getRowCount();
                }
                catch (final Exception ex)
                {
                    rowsPerPage = 0;
                }
                if (rowsPerPage < 1)
                {
                    rowsPerPage = DEFAULT_ROWS_PER_PAGE;
                }
                usersTable.setRowsPerPage(rowsPerPage);
                target.addComponent(usersTable);
            }
        });
        usersDiv.add(usersDropDown);
        final List<IColumn<ReportDisplayItem>> usersColumns = new ArrayList<IColumn<ReportDisplayItem>>();
        usersColumns.add(new TextFilteredPropertyColumn<ReportDisplayItem, String>(new StringResourceModel("FirstName", this, null),
                "firstName", "firstName"));
        usersTable = new AjaxFallbackDefaultDataTable<ReportDisplayItem>("table", usersColumns, dataProvider, rowsPerPage);
        usersDiv.add(usersTable)

HTML

<html>
<wicket:extend>
    <div class="user-management">
        <div wicket:id="navborder">
            <div wicket:id="reportsDiv">
                <div id="header-title" class="topheader">
                    <div class="topsubheader">
                        <p><wicket:message key="LiteralReports">Reports</wicket:message></p>
                    </div>
                </div>

                <div wicket:id="feedback" class="error-message"></div>

                <div class="row row-auto">
                    <div class="column-1"></div>
                    <div class="column-2"><hr width="60%" align="left"></div>
                </div>

                <div class="section" wicket:id="usersDiv">
                    <div class="row section-header datatable-header">
                        <div class="column-1and2">
                            <wicket:message key="LiteralLocalUsers">Users (Local)</wicket:message>
                            <span class="shownumberofrecords">
                                <wicket:message key="LiteralDisplay">Display:</wicket:message>
                                <select wicket:id="usersDropdown"></select>
                                <wicket:message key="LiteralItems">items</wicket:message>
                            </span>
                        </div>
                    </div>
                    <div class="row row-auto">
                        <div class="column-1and2">
                            <!-- <table class="dataview" cellspacing="0" wicket:id="table">[table]</table> -->
                            <form wicket:id="FilterForm" id="FilterForm">
                                <input type="hidden" name="tracker" wicket:id="focus-tracker"/>
                                <table class="dataview" cellspacing="0" wicket:id="table">[table]</table>
                                <span wicket:id="focus-restore">[call to focus restore script]</span>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</wicket:extend>
</html>

0 个答案:

没有答案