WizardStep grid.setItems gives NullPointerException
mvmchp opened this issue · 2 comments
I'm sure I'm missing something, but when I try to add data to a Grid or a ComboBox inside the getContent() of a WizardStep I get a NPE.
If I change:
technology.setItems(techrepository.getTechnologies());
to:
technology.setItems("200k", "30k");
Everything works correctly.
Here's my WizardStep:
`public class CreatMonSecondStep implements WizardStep {
@Autowired
private MonitorArchiveRepository techrepository ;
private ComboBox technology;
public String getCaption() { return "Technology"; }
public Component getContent() {
VerticalLayout content = new VerticalLayout();
content.setSizeFull();
content.setMargin(true);
Label text = new Label(
"<h2></h2><p>Choose from the following Technologies:",
ContentMode.HTML);
content.addComponent(text);
technology = new ComboBox<>();
technology.setItems(techrepository.getTechnologies());
content.addComponent(technology);
return content;
}
public boolean onAdvance() { return true; }
public boolean onBack() { return true; }
}`
I'm using Wizards for Vaadin 2.0.0 and Vaadin 8.0.3 with SpringBoot 1.4.3
Where does techrepository
get initialized ?
I would suggest you to make sure you have Vaadin Spring and/or Vaadin Spring Boot installed and you have correctly annotated your UIs to enable usage of @Autowired
.
Closing the issue as the problem is not directly related to Wizards for Vaadin add-on.