From fa4b2adc38b6664e0113109416531e4a2b96e2f7 Mon Sep 17 00:00:00 2001 From: Josefina Revilla Date: Fri, 8 Sep 2017 17:05:41 -0300 Subject: [PATCH] Refactor in QIEntityView, navigate to new route now on own method --- modules/qi-core/src/main/java/org/jpos/qi/QIEntityView.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/qi-core/src/main/java/org/jpos/qi/QIEntityView.java b/modules/qi-core/src/main/java/org/jpos/qi/QIEntityView.java index 8bd0c492c4..04ce930dca 100644 --- a/modules/qi-core/src/main/java/org/jpos/qi/QIEntityView.java +++ b/modules/qi-core/src/main/java/org/jpos/qi/QIEntityView.java @@ -192,13 +192,17 @@ protected HorizontalLayout createHeader (String title) { Button addBtn = new Button(getApp().getMessage("add")); addBtn.addStyleName("borderless-colored"); addBtn.setIcon(VaadinIcons.PLUS); - addBtn.addClickListener(event -> getApp().getNavigator().navigateTo(generalRoute + "/new")); + addBtn.addClickListener(event -> navigateToNewRoute()); header.addComponent(addBtn); header.setComponentAlignment(addBtn, Alignment.BOTTOM_RIGHT); } return header; } + protected void navigateToNewRoute() { + getApp().getNavigator().navigateTo(generalRoute + "/new"); + } + public Grid createGrid() { Grid g = new Grid(); g.setSizeFull();