The Unified and Autonomous Development Platform
midwork
robin shine5e82590862c7
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.htmlindex 9c72343fc8..2b704e5dbf 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.html+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.html@@ -1,6 +1,19 @@<wicket:extend>- <form wicket:id="form" onsubmit="return false;">- <input wicket:id="name"></input>- <input wicket:id="save" type="button" value="Save"></input>- </form>+ <table>+ <tr wicket:id="rows">+ <td wicket:id="column1"></td>+ <td wicket:id="column2"></td>+ <td wicket:id="column3"></td>+ <td wicket:id="column4"></td>+ <td wicket:id="column5"></td>+ <td wicket:id="column6"></td>+ <td wicket:id="column7"></td>+ <td wicket:id="column8"></td>+ <td wicket:id="column9"></td>+ <td wicket:id="column10"></td>+ <td wicket:id="column11"></td>+ <td wicket:id="column12"></td>+ </tr>+ </table>+ <a wicket:id="expand">expand</a></wicket:extend>\ No newline at end of filediff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.javaindex d829e4fa0e..e1a3a48641 100644--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.java+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.java@@ -1,58 +1,74 @@package com.pmease.gitplex.web.page.test;+import org.apache.wicket.Component;import org.apache.wicket.ajax.AjaxRequestTarget;-import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;-import org.apache.wicket.markup.html.form.Form;-import org.apache.wicket.markup.html.form.TextField;-import org.apache.wicket.model.IModel;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.repeater.RepeatingView;import com.pmease.gitplex.web.page.base.BasePage;@SuppressWarnings("serial")public class TestPage extends BasePage {- private String name;+ private RepeatingView rows;@Overrideprotected void onInitialize() {super.onInitialize();-- Form<Void> form = new Form<Void>("form") {-- @Override- protected void onSubmit() {- super.onSubmit();- System.out.println("form submit: " + name);- }-- };- form.add(new TextField<String>("name", new IModel<String>() {-- @Override- public void detach() {- }++ rows = new RepeatingView("rows");+ for (int i=0; i<10000; i++) {+ rows.add(newRow(rows.newChildId()));+ }+ add(rows);++ add(new AjaxLink<Void>("expand") {@Override- public String getObject() {- return name;- }-- @Override- public void setObject(String object) {- name = object;- }-- }));- form.add(new AjaxSubmitLink("save") {-- @Override- protected void onSubmit(AjaxRequestTarget target, Form<?> form) {- super.onSubmit(target, form);- System.out.println("button submit: " + name);+ public void onClick(AjaxRequestTarget target) {+ StringBuilder builder = new StringBuilder();+ for (int i=0; i<10; i++) {+ String time = String.valueOf(System.currentTimeMillis());+ builder.append(String.format(""+ + "<tr id='%s'>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "<td>%s</td>"+ + "</tr>",+ time, time, time, time, time, time, time, time, time, time, time, time, time));+ }+ target.appendJavaScript(String.format("$('table').append(\"%s\");", builder.toString()));}});- add(form);}+ private Component newRow(String id) {+ WebMarkupContainer row = new WebMarkupContainer(id);+ row.add(new Label("column1", System.currentTimeMillis()));+ row.add(new Label("column2", System.currentTimeMillis()));+ row.add(new Label("column3", System.currentTimeMillis()));+ row.add(new Label("column4", System.currentTimeMillis()));+ row.add(new Label("column5", System.currentTimeMillis()));+ row.add(new Label("column6", System.currentTimeMillis()));+ row.add(new Label("column7", System.currentTimeMillis()));+ row.add(new Label("column8", System.currentTimeMillis()));+ row.add(new Label("column9", System.currentTimeMillis()));+ row.add(new Label("column10", System.currentTimeMillis()));+ row.add(new Label("column11", System.currentTimeMillis()));+ row.add(new Label("column12", System.currentTimeMillis()));+ row.setOutputMarkupId(true);+ return row;+ }}