我在新的Scout Neon工作,我开始收到错误:
Assertion error: Property 'modal' cannot be changed because Form is already showing
我的表单有属性:
@Override
protected int getConfiguredModalityHint() {
return MODALITY_HINT_MODELESS;
}
@Override
protected int getConfiguredDisplayHint() {
return DISPLAY_HINT_VIEW;
}
@Override
protected String getConfiguredDisplayViewId() {
return VIEW_ID_CENTER;
}
我做错了什么?
编辑:Marko我在MyOutline
中添加页面,从AbstractOutline
public class MyOutline extends AbstractOutline {
@Override
protected String getConfiguredTitle() {
return TEXTS.get("MyOutline");
}
@Override
protected void execCreateChildPages(final List<IPage<?>> pageList) {
final MyPage myPage = new MyPage();
pageList.add(myPage);
super.execCreateChildPages(pageList);
}
}
MyPage
只是表单的包装页面。
public class MyPage extends AbstractPageWithNodes {
@Override
protected boolean getConfiguredLeaf() {
return true;
}
@Override
protected boolean getConfiguredTableVisible() {
return false;
}
@Override
protected String getConfiguredTitle() {
return TEXTS.get("MyPage");
}
@Override
protected Class<? extends IForm> getConfiguredDetailForm() {
return MyForm.class;
}
}
我的表格没什么空间的:
@FormData(value = MyFormData.class, sdkCommand = FormData.SdkCommand.CREATE)
公共类MyForm扩展了AbstractForm {
/**
* Method start Form for adding new person.
*/
public void startNew() {
this.startInternal(new NewHandler());
}
@Override
protected boolean getConfiguredAskIfNeedSave() {
return false;
}
@Override
protected int getConfiguredModalityHint() {
return MODALITY_HINT_MODELESS;
}
@Override
protected int getConfiguredDisplayHint() {
return DISPLAY_HINT_VIEW;
}
@Override
protected String getConfiguredDisplayViewId() {
return VIEW_ID_CENTER;
}
public MainBox getMainBox() {
...
但是当我想打开这个页面时(在此页面上没有打开启动应用程序),(之前我没有做任何其他事情)我得到了错误。
2016-01-22 11:13:56,236 ERROR scout-model-thread-11 'Processing JSON request' o.e.scout.rt.platform.exception.ExceptionHandler -
org.eclipse.scout.rt.platform.util.Assertions$AssertionException: Assertion error: Property 'modal' cannot be changed because Form is already showing
at org.eclipse.scout.rt.platform.util.Assertions.fail(Assertions.java:581) ~[org.eclipse.scout.rt.platform-5.2.0.M4.jar:5.2.0.M4]
at org.eclipse.scout.rt.platform.util.Assertions.assertFalse(Assertions.java:192) ~[org.eclipse.scout.rt.platform-5.2.0.M4.jar:5.2.0.M4]
at org.eclipse.scout.rt.client.ui.form.AbstractForm.setModal(AbstractForm.java:2700) ~[org.eclipse.scout.rt.client-5.2.0.M4.jar:5.2.0.M4]
at org.eclipse.scout.rt.client.ui.desktop.outline.pages.AbstractPage.decorateDetailForm(AbstractPage.java:692) ~[org.eclipse.scout.rt.client-5.2.0.M4.jar:5.2.0.M4]
答案 0 :(得分:0)
我找到了解决问题的方法。
在我的构造函数中,我有:
public PersonsExtensionFieldForm() {
this.startInternal(new NewHandler());
}
女巫没问题,当你打开其他表格的表格时,例如点击按钮。
但是当您将表单作为Detail
表单放在页面中时,您需要
public PersonsExtensionFieldForm() {
this.setHandler(new NewHandler());
}