Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java TypeError:无法读取未定义的属性“initLazy”?_Java_Wildfly_Vaadin_Vaadin Flow - Fatal编程技术网

Java TypeError:无法读取未定义的属性“initLazy”?

Java TypeError:无法读取未定义的属性“initLazy”?,java,wildfly,vaadin,vaadin-flow,Java,Wildfly,Vaadin,Vaadin Flow,我是瓦丁发展公司的新手。试着为Wildfly建立一个项目。 我将Vaadin14.1.16与Wildfly 18和Java8一起使用。 当我加载页面时,页面出现错误,如下所示 (TypeError) : Cannot read property 'initLazy' of undefined 此外,文本区域不会出现在页面上 注释标签位于右侧,而我希望位于选择组件下。 我已经尝试在谷歌上找到任何与这个问题有关的东西,但没有找到 Vaadin genius,你知道我为什么要解决这个问题吗 页面截图

我是瓦丁发展公司的新手。试着为Wildfly建立一个项目。 我将Vaadin14.1.16与Wildfly 18和Java8一起使用。 当我加载页面时,页面出现错误,如下所示

(TypeError) : Cannot read property 'initLazy' of undefined
此外,文本区域不会出现在页面上

注释标签位于右侧,而我希望位于选择组件下。 我已经尝试在谷歌上找到任何与这个问题有关的东西,但没有找到

Vaadin genius,你知道我为什么要解决这个问题吗

页面截图。

删除此行:

ui.getPage().executeJs("window.Vaadin.Flow.comboBoxConnector.initLazy($0);", getElement());
删除此行:

ui.getPage().executeJs("window.Vaadin.Flow.comboBoxConnector.initLazy($0);", getElement());
TypeError:无法读取未定义的属性“initLazy”

javascript窗口.Vaadin.Flow.comboBoxConnector.initLazy$0;在将组合框附加到页面时自动调用。完全没有必要自己做这件事。 即使您说runBeforeClientResponse方法从未在代码中使用,请将其删除。因为错误消息非常清楚,这一行是错误的罪魁祸首

而且组合框和文本区域不会显示

这可能是因为您使用以下行多次将相同的组件添加到最终布局中:wrapper.addformLayout;这一行总共调用了3次,因此您将在editorDiv中对整个formLayout进行三次调用。多次添加同一组件实例永远不会有好结果。将其更改为:

private void createEditorLayout(SplitLayout splitLayout) {
    Div editorDiv = new Div();
    editorDiv.setId("maintenance-layout");

    FormLayout formLayout = new FormLayout();
//        addFormItem(editorDiv, formLayout, operationComboBox, "Operation Mode");
    addFormItem(formLayout, maintenanceSelector, "Operation Mode");
    addFormItem(formLayout, commentTextArea, "Comment");
    addFormItem(formLayout, passwordField, "Password");
    editorDiv.add(formLayout);
    editorDiv.add(btnOperation);

    splitLayout.addToSecondary(editorDiv);
}

private void addFormItem(FormLayout formLayout, AbstractField field, String fieldName) {
    formLayout.addFormItem(field, fieldName);
    field.getElement().getClassList().add("full-width");
}
TypeError:无法读取未定义的属性“initLazy”

javascript窗口.Vaadin.Flow.comboBoxConnector.initLazy$0;在将组合框附加到页面时自动调用。完全没有必要自己做这件事。 即使您说runBeforeClientResponse方法从未在代码中使用,请将其删除。因为错误消息非常清楚,这一行是错误的罪魁祸首

而且组合框和文本区域不会显示

这可能是因为您使用以下行多次将相同的组件添加到最终布局中:wrapper.addformLayout;这一行总共调用了3次,因此您将在editorDiv中对整个formLayout进行三次调用。多次添加同一组件实例永远不会有好结果。将其更改为:

private void createEditorLayout(SplitLayout splitLayout) {
    Div editorDiv = new Div();
    editorDiv.setId("maintenance-layout");

    FormLayout formLayout = new FormLayout();
//        addFormItem(editorDiv, formLayout, operationComboBox, "Operation Mode");
    addFormItem(formLayout, maintenanceSelector, "Operation Mode");
    addFormItem(formLayout, commentTextArea, "Comment");
    addFormItem(formLayout, passwordField, "Password");
    editorDiv.add(formLayout);
    editorDiv.add(btnOperation);

    splitLayout.addToSecondary(editorDiv);
}

private void addFormItem(FormLayout formLayout, AbstractField field, String fieldName) {
    formLayout.addFormItem(field, fieldName);
    field.getElement().getClassList().add("full-width");
}

在与瓦丁人沟通后,他们向我提出以下建议:

Hi! looks like the front-end bundle hasn't updated; 
after adding the combobox to the view, did you restart the app? 
Vaadin needs to run mvn Vaadin:prepare-frontend to include the new component.
在问题意外解决后,我做了以下工作。谢谢大家的好意

1-停止狂野飞行

2-maven:干净

3-瓦丁:战争


4-重新启动服务器wildfly。

与来自Vaadin的人员沟通后,他们建议我:

Hi! looks like the front-end bundle hasn't updated; 
after adding the combobox to the view, did you restart the app? 
Vaadin needs to run mvn Vaadin:prepare-frontend to include the new component.
在问题意外解决后,我做了以下工作。谢谢大家的好意

1-停止狂野飞行

2-maven:干净

3-瓦丁:战争


4-重新启动服务器wildfly。

我不确定您使用window.Vaadin.Flow.comboBoxConnector.initLazy$0试图实现什么。你在哪里学的,预计会发生什么?我想做的是在页面上显示一些组件,比如组合框。联合国,幸运的是,我得到了这个错误,Combobox和Textarea没有显示。我不确定你试图用window.Vaadin.Flow.comboBoxConnector.initLazy$0实现什么。你在哪里学的,预计会发生什么?我想做的是在页面上显示一些组件,比如组合框。联合国,幸运的是,我得到了这个错误,组合框和文本区域没有显示。这个方法从来没有在我的代码中使用过,所以在那里没有关系。这个方法从来没有在我的代码中使用过,我已经像你说的那样修改了代码,还有一点,但是仍然得到了以前的错误和更多的错误:TypeError:无法读取未定义TypeError的属性'confirm':无法读取未定义TypeError的属性'set':无法读取未定义TypeError的属性'updateSize'。我已经像你说的那样修改了代码,并且稍多一点,但仍会收到以前的错误和更多错误,如:TypeError:无法读取未定义TypeError的属性“confirm”:无法读取未定义TypeError的属性“set”:无法读取未定义TypeError的属性“updateSize”