作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Vaadin 开发的新手。尝试为 Wildfly 建立一个项目。我将 Vaadin 14.1.16 与 Wildfly 18 和 Java 8 结合使用。当我加载页面时,页面出现错误,如下所示。
(TypeError) : Cannot read property 'initLazy' of undefined
此外,textArea 不会出现在页面上。
注释标签
位于右侧,而我预计位于选择组件
下方。我已经尝试在谷歌上找到与此问题相关的任何内容,但船上没有任何内容。
Vaadin 天才,你知道为什么以及我应该如何解决它吗?
@Route(value = "maintenance", layout = MainView.class)
@PageTitle("Maintenance Mode Selector")
public class MaintenanceView extends Div implements AfterNavigationObserver {
@Inject
private Maintenance maintenance;
private ComboBox<MaintenanceMode> operationComboBox = new ComboBox<>(MaintenanceMode.NORMAL_OPERATION.getDescription());
private Select<String> maintenanceSelector = new Select();
private TextArea commentTextArea = new TextArea();
private PasswordField passwordField = new PasswordField();
private Button btnOperation = new Button("Set Operation Mode");
public MaintenanceView() {
setId("maintenance-view");
operationComboBox.setItemLabelGenerator(MaintenanceMode::getDescription);
operationComboBox.setItems(MaintenanceMode.values());
maintenanceSelector.setItems("MAINTENANCE OPERATION", "NORMAL OPERATION");
maintenanceSelector.getStyle().set("width", "40em");
maintenanceSelector.setPlaceholder("CHOOSE AN OPERATION");
commentTextArea.getStyle().set("minHeight", "200em");
commentTextArea.setPlaceholder("Down time is expected to be 30 minute ...");
commentTextArea.addThemeVariants(TextAreaVariant.LUMO_SMALL);
btnOperation.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
btnOperation.addClickListener(buttonClickEvent -> {
maintenance.setMode("MAINTENANCE OPERATION".equals(maintenanceSelector.getValue()) ? "1" : "0");
maintenance.setComment(commentTextArea.getValue());
});
SplitLayout splitLayout = new SplitLayout();
splitLayout.setOrientation(SplitLayout.Orientation.HORIZONTAL);
splitLayout.setSizeFull();
createEditorLayout(splitLayout);
add(splitLayout);
}
private void createEditorLayout(SplitLayout splitLayout) {
FormLayout formLayout = new FormLayout();
formLayout.setResponsiveSteps(
new FormLayout.ResponsiveStep("40em",2, FormLayout.ResponsiveStep.LabelsPosition.TOP),
new FormLayout.ResponsiveStep("40em",1, FormLayout.ResponsiveStep.LabelsPosition.TOP),
new FormLayout.ResponsiveStep("40em",2, FormLayout.ResponsiveStep.LabelsPosition.TOP),
new FormLayout.ResponsiveStep("40em",1, FormLayout.ResponsiveStep.LabelsPosition.TOP)
);
formLayout.addFormItem( operationComboBox, "Combobox Component:");
formLayout.addFormItem( maintenanceSelector, "Select Component:");
formLayout.addFormItem( commentTextArea, "Comments:");
formLayout.addFormItem( passwordField, "Password:");
formLayout.addFormItem( btnOperation,"");
formLayout.setColspan(operationComboBox,2);
formLayout.setColspan(maintenanceSelector,2);
formLayout.setColspan(commentTextArea,2);
formLayout.setColspan(passwordField,2);
formLayout.setColspan(btnOperation,1);
splitLayout.addToSecondary(formLayout);
}
@Override
public void afterNavigation(AfterNavigationEvent afterNavigationEvent) {
}
}
我稍微改变了布局,但现在出现了这些错误。
(TypeError) : Cannot read property 'confirm' of undefined
(TypeError) : Cannot read property 'set' of undefined
(TypeError) : Cannot read property 'updateSize' of undefined
最佳答案
删除此行:
ui.getPage().executeJs("window.Vaadin.Flow.comboBoxConnector.initLazy($0);", getElement());
关于java - 类型错误 : Cannot read property 'initLazy' of undefined?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60093977/
我是 Vaadin 开发的新手。尝试为 Wildfly 建立一个项目。我将 Vaadin 14.1.16 与 Wildfly 18 和 Java 8 结合使用。当我加载页面时,页面出现错误,如下所示。
我是一名优秀的程序员,十分优秀!