Skip to content

Commit 00d9897

Browse files
committed
cleaned up DataTablesAjaxSimple & DataTableAjaxSimpleTest
1 parent 81fdff4 commit 00d9897

File tree

3 files changed

+2
-47
lines changed

3 files changed

+2
-47
lines changed

src/test/java/org/got5/tapestry5/jquery/DataTableAjaxSimpleTest.java

-31
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,6 @@
77

88
public class DataTableAjaxSimpleTest extends SeleniumTestCase {
99

10-
@Test
11-
public void testHeaderOverride() {
12-
this.open("/DataTablesAjaxSimple");
13-
14-
new Wait() {
15-
16-
@Override
17-
public boolean until() {
18-
return DataTableAjaxSimpleTest.this.getText("//table[@id='datatableAjax']/thead/tr/th[2]/div[@class='DataTables_sort_wrapper']")
19-
.contains("Header");
20-
}
21-
}.wait("The Header is wrong : "
22-
+ this.getText("//table[@id='datatableAjax']/thead/tr/th[2]/div[@class='DataTables_sort_wrapper']"),
23-
JQueryTestConstants.TIMEOUT);
24-
}
25-
26-
@Test
27-
public void testFooterOverride() {
28-
this.open("/DataTablesAjaxSimple");
29-
30-
new Wait() {
31-
32-
@Override
33-
public boolean until() {
34-
return DataTableAjaxSimpleTest.this.getText("//table[@id='datatableAjax']/tfoot/tr/th[2]")
35-
.contains("Footer");
36-
}
37-
}.wait("The Footer is wrong : " + this.getText("//table[@id='datatableAjax']/tfoot/tr/th[2]"),
38-
JQueryTestConstants.TIMEOUT);
39-
}
40-
4110
@Test
4211
public void testNumberRows5() {
4312
this.open("/DataTablesAjaxSimple");

src/test/java/org/got5/tapestry5/jquery/pages/DataTablesAjaxSimple.java

+1-15
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ public class DataTablesAjaxSimple {
3939
@Property
4040
private Celebrity current;
4141

42-
@Property
43-
private int index;
44-
4542
public List<Celebrity> getAllCelebrities() {
4643
System.out.println("Getting all celebrities...");
4744
return this.dataSource.getAllCelebrities();
@@ -57,17 +54,6 @@ public void setCelebrity(Celebrity celebrity) {
5754

5855
public JSONObject getOptions() {
5956

60-
return new JSONObject("bJQueryUI", "true"/*, "sDom", "TC<\"clear\">Rlfrtip"*/);
57+
return new JSONObject("bJQueryUI", "true", "sDom", "TC<\"clear\">Rlfrtip");
6158
}
62-
63-
/**
64-
* Event handler method called when datatable's search field is used
65-
* Gives a chance to the user to filter data in lazy-loading mode (mode=true)
66-
* */
67-
// @OnEvent(value = JQueryEventConstants.FILTER_DATA, component = "datatableAjax")
68-
// public void filterData() {
69-
// String val = this.request.getParameter(DataTableConstants.SEARCH);
70-
// this.dataSource.filter(val);
71-
// }
72-
7359
}

src/test/resources/org/got5/tapestry5/jquery/pages/DataTablesAjaxSimple.tml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<html t:type="layout" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
22

3-
<table t:type="jquery/datatable" t:source="allCelebrities" rowsPerPage="5" exclude="id, biography, birthDateVerified" reorder="link,firstName,lastName,occupation,dateOfBirth" options="options" t:mode="true" t:add="link" t:id="datatableAjax" id="datatableAjax">
3+
<table t:type="jquery/datatable" t:source="allCelebrities" rowsPerPage="5" exclude="id, biography, birthDateVerified" reorder="link,firstName,lastName,occupation,dateOfBirth" options="options" t:mode="true" t:row="current" t:add="link" t:id="datatableAjax" id="datatableAjax">
44

55
<p:firstNameHeader>Prénom Header</p:firstNameHeader>
66

0 commit comments

Comments
 (0)