WicketのDataTable

使い方がよくわからなかったので、個人的メモ

public class HomePage extends WebPage {
	
	public HomePage(PageParameters param) {
		// TODO Auto-generated constructor stub
		
		 IColumn[] columns = new IColumn[2];
		 
		 columns[0] = new PropertyColumn<String>(new Model<String>("First Name"), "name");
		 columns[1] = new PropertyColumn<String>(new Model<String>("Last Name"), "add");
		 
		 List<TestList> lis = Arrays.asList(list);
		 DataTable<TestList> table = new DataTable<TestList>("datatable", columns, new ListDataProvider<TestList>(lis), 10);
		 table.addBottomToolbar(new NavigationToolbar(table));
		 table.addTopToolbar(new HeadersToolbar(table, null));
		 add(table);

	}
	
	TestList[] list = {new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto"),
			new TestList("sample", "test"),new TestList("koreha", "tesuto")};
	
	private class TestList implements Serializable{
		private String name;
		private String add;
		
		public TestList(String name, String add) {
			// TODO Auto-generated constructor stub
			this.name = name;
			this.add = add;
		}
	}
}