Hello,
sometimes after navigation from one page to another GridLayout gets scattered and mislayouted.
After reloading the page layout is right.
Only observer in IE10 and Vaadin7.
package cz.marbes.daisy.admin.pages.healthreport;
@Page
@PageItemMenu(caption = "Health reports", order = 0,
groupCaption = AdminMenuTools.MENU_KONFIGURACE_CAPTION, groupOrder = AdminMenuTools.MENU_KONFIGURACE_ORDER)
public class HealthReportPage extends CustomComponent implements View {
private HealthReportController controller = new HealthReportController();
public void enter(final ViewChangeListener.ViewChangeEvent event) {
setHeight("90%");
VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
layout.addComponent(new TitlePanel("Health reports",
"Systém Health reports slouží k monitorování běhu aplikací a vede k"
+ " významnému urychlení identifikace, řešení nebo i předcházení problémů."));
layout.addComponent(new Spacer());
GridLayout gridLayout = new GridLayout(2, 1);
gridLayout.setSpacing(true);
{
gridLayout.addComponent(new DescriptionLabel("Naposledy odesláno:"));
gridLayout.addComponent(new Label(controller.getNaposledyOdelano()));
gridLayout.addComponent(new DescriptionLabel("Způsob odesílání:"));
String stavOdesilani = "";
if (controller.odesilatPresHttps() && controller.odesilatMailem()) {
stavOdesilani = "HTTPS / email";
} else if (controller.odesilatPresHttps()) {
stavOdesilani = "HTTPS";
} else if (controller.odesilatMailem()) {
stavOdesilani = "email";
}else{
stavOdesilani = "vypnuto";
}
gridLayout.addComponent(new Label(stavOdesilani));
}
layout.addComponent(gridLayout);
layout.addComponent(new Spacer());
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setSpacing(true);
{
buttonLayout.addComponent(new Button("Stáhnout XML soubor", new Button.ClickListener() {
@Override
public void buttonClick(final Button.ClickEvent event) {
controller.stahnoutXmlSoubor();
}
}));
buttonLayout.addComponent(new Spacer());
buttonLayout.addComponent(new Button("Odeslat mailem", new Button.ClickListener() {
@Override
public void buttonClick(final Button.ClickEvent event) {
controller.odeslatMailem();
}
}));
buttonLayout.addComponent(new Spacer());
buttonLayout.addComponent(new Button("Odeslat přes HTTPS", new Button.ClickListener() {
@Override
public void buttonClick(final Button.ClickEvent event) {
controller.odeslatPresHttps();
}
}));
}
layout.addComponent(buttonLayout);
layout.addComponent(new Spacer());
final Table table = new Table(TableStyle.LIGHT);
table.setSizeFull();
table.setSelectable(false);
table.setContainerDataSource(controller.getIndexContainer());
table.setVisibleColumns(new String[] {"stav", "nazev", "aktualniHodnota", "hintJakNapravit"});
table.setColumnHeaders(new String[] { "Stav", "Název kontoly", "Hodnota", "Popis"});
layout.addComponent(table);
layout.setExpandRatio(table, 1);
setCompositionRoot(layout);
}
}