I am trying to take input from the below screen and open Birt Report directly into PDF. (I am using Vaadin 14)
Problem: My Anchor/Button is not opening any link on the first click every time this UI gets loaded. But After clicking once from the second click onward, it is working fine. Any Idea what can be the issue and what mistake I've made?
Below are my global Variables:
final Button printButton =
new Button("Print Report", VaadinIcon.PRINT.create());
String url = null;
final Anchor anchorReport = new Anchor();
My Consutructor:
public AssignmentCompletedAllRPTView()
{
super();
this.initUI();
this.radioButtonGroup.setItems("Yes", "No");
this.printButton.addClickListener(new ComponentEventListener<ClickEvent<Button>>()
{
@Override
public void onComponentEvent(final ClickEvent<Button> event)
{
AssignmentCompletedAllRPTView.this.printButton();
}
});
this.ConfigureReportButton();
}
ConfigureReportButton():
private void ConfigureReportButton()
{
this.anchorReport.setTarget("_blank");
this.anchorReport.add(this.printButton);
this.buttonHorizontalLayout.add(this.anchorReport);
}
printButton():
private void printButton()
{
final String reportURL = //--URL
this.anchorReport.setHref(reportURL);
}