Skip to content

Commit

Permalink
fix NewPage for #702
Browse files Browse the repository at this point in the history
upgrade jquery-selectors, disable csp, fixed unfinite loop in
PeopleDataProvider
  • Loading branch information
Sven Meier committed Dec 14, 2020
1 parent cfbfec7 commit b294c2d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ protected void init() {
getMarkupSettings().setStripWicketTags(true);

configureResourceGuard();

getCspSettings().blocking().disabled();
}

private void configureResourceGuard() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,25 @@ public Iterator<? extends Person> iterator(long first, long count) {
List<Person> people = new ArrayList<>();
Random random = new Random(123);

for (int i = 0; i < count;) {
for (int i = 0; i < FIRST_NAMES.length * LAST_NAMES.length; i++) {
int randomFirst = random.nextInt(FIRST_NAMES.length);
int randomLast = random.nextInt(LAST_NAMES.length);
int randomAge = random.nextInt(99);
final String firstName = FIRST_NAMES[randomFirst];
final String lastName = LAST_NAMES[randomLast];
if (searchFilter != null && (firstName.toLowerCase().contains(searchFilter) || lastName.toLowerCase().contains(searchFilter) )) {
if (searchFilter == null || (firstName.toLowerCase().contains(searchFilter) || lastName.toLowerCase().contains(searchFilter) )) {
people.add(new Person(firstName, lastName, randomAge, first + i));
i++;
}
if (people.size() >= count) {
break;
}
}
return people.iterator();
}

@Override
public long size() {
return FIRST_NAMES.length;
return FIRST_NAMES.length * LAST_NAMES.length;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion datatables-parent/datatables/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<dependency>
<groupId>de.agilecoders.wicket</groupId>
<artifactId>jquery-selectors</artifactId>
<version>3.0.0-M4</version>
<version>3.0.2</version>
</dependency>
</dependencies>
</project>

0 comments on commit b294c2d

Please sign in to comment.