Browse Source

dirty reroute fix

master
GAM 4 years ago
parent
commit
47568d122c
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      src/main/java/com/example/application/views/abstractnavigation/SeasonAndMatchdayNavigationView.java

+ 7
- 0
src/main/java/com/example/application/views/abstractnavigation/SeasonAndMatchdayNavigationView.java View File

@ -136,6 +136,13 @@ public abstract class SeasonAndMatchdayNavigationView extends Div implements Has
public void setParameter(BeforeEvent beforeEvent, @WildcardParameter String param) {
outer.removeAll();
// TODO: replace this with something more sensible
if (param.equals("")) {
navigate(UI.getCurrent(), "2020", "1");
setParameter(beforeEvent, "2020/1/");
return;
}
if (!param.matches("^[0-9]*/[0-9]*/?$")) {
invalidUrlLabel.setText("Invalid URL! Please provide params in the form season/matchday/");
outer.add(invalidUrlLabel);


Loading…
Cancel
Save