Hi all,
I’m experiencing a problem where by if I use the @Push annotation, when I get the CurrentResponse from the VaadinService its Null.
i.e.
@Push
@Route(value = "test")
public class TestView extends VerticalLayout {
private static Logger log = LoggerFactory.getLogger(TestView.class);
@PostConstruct
public void init() {
Button button = new Button("Let's Go");
button.addClickListener(e -> {
log.error("the current response is: " +
(VaadinService.getCurrentResponse() == null ? "Null" : "Not Null")); // <-- Null Here
});
add(button);
log.error("the current response is: " +
(VaadinService.getCurrentResponse() == null ? "Null" : "Not Null")); // <-- Not Null Here
}
}
If I remove the @Push, both calls to getCurrentResponse are ‘Not Null’.
Is this right? I’m trying to add cookies, but also need Push as updates are made in a background thread.
Thanks for any info,
Stuart.