You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a TouchKit NavigationView which needs to fetch data from the database every time the page is viewed. The first time the page is displayed, the methods init (when used with PreConstruct) and attach is invoked. For all subsequently display of the page, those methods are not invoked and hence I cannot refresh the page with the latest data (which might have changed in the database). I understand that a lot of work is still under progress. I only want to know if I am doing anything wrong at the moment. Below is the code -
@SuppressWarnings("serial")
@VaadinComponent
@VaadinUIScope
public class ServerManagement extends NavigationView
{ @Autowired
private ServerRepository serverRepository;
@PostConstruct
protected void init()
{
}
@Override
public void attach()
{
super.attach();
System.out.println("fetching servers");
setCaption("Server Mgmt");
// Main container to hold all the components
final CssLayout viewGroup = new CssLayout();
final VerticalComponentGroup serverGroup = new VerticalComponentGroup();
serverGroup.setCaption("Server List");
viewGroup.addComponent(serverGroup);
// List of servers showing IP addresses
Iterable<Server> servers = serverRepository.findAll();
for(Server server : servers) {
NavigationButton serverButton = new NavigationButton(server.getIpAddress());
serverGroup.addComponent(serverButton);
}
// Set the content of the screen with the main container
setContent(viewGroup);
}
}
The text was updated successfully, but these errors were encountered:
Hi,
I have a TouchKit NavigationView which needs to fetch data from the database every time the page is viewed. The first time the page is displayed, the methods init (when used with PreConstruct) and attach is invoked. For all subsequently display of the page, those methods are not invoked and hence I cannot refresh the page with the latest data (which might have changed in the database). I understand that a lot of work is still under progress. I only want to know if I am doing anything wrong at the moment. Below is the code -
package com.ist.datacenter.ui;
import com.ist.datacenter.domain.Server;
import com.ist.datacenter.repository.jpa.ServerRepository;
import com.vaadin.addon.touchkit.ui.NavigationButton;
import com.vaadin.addon.touchkit.ui.NavigationView;
import com.vaadin.addon.touchkit.ui.VerticalComponentGroup;
import com.vaadin.ui.CssLayout;
import org.springframework.beans.factory.annotation.Autowired;
import org.vaadin.spring.annotation.VaadinComponent;
import org.vaadin.spring.annotation.VaadinUIScope;
import javax.annotation.PostConstruct;
@SuppressWarnings("serial")
@VaadinComponent
@VaadinUIScope
public class ServerManagement extends NavigationView
{
@Autowired
private ServerRepository serverRepository;
}
The text was updated successfully, but these errors were encountered: