- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我调用这个ImportCommandAction
它被定义为公共(public)类 ImportCommandAction <D extends ActionDefinition> extends AbstractVersionAction<D>
作为页面上的操作。自定义导入操作有自己的 VersionName 类并覆盖 getBeanItemClass()。每次我调用这个类时,我都会在日志中得到一个条目
WARN magnolia.ui.form.field.factory.AbstractFieldFactory: BeanItem doesn't have any property for id versionName, returning default property.
我不明白这个警告以及 ui.form.field.factory.AbstractFieldFactory
的 id 是什么。指。该类打开一个对话框并列出内部 git 存储库的所有版本(提交)。
类代码:
public ImportCommandAction(
D definition, AppContext appContext, LocationController locationController,
UiContext uiContext, FormDialogPresenter formDialogPresenter,
AbstractJcrNodeAdapter nodeAdapter, SimpleTranslator i18n,
ContentConnector contentConnector)
{
super(definition, locationController, uiContext, formDialogPresenter, i18n);
this.nodeAdapter = nodeAdapter;
this.appContext = appContext;
this.dialogID = "ui-contentapp:code:ImportCommandAction.selectVersion";
this.contentConnector = contentConnector;
}
@Override
protected Class getBeanItemClass() {
return VersionName.class;
}
@Override
protected FormDialogDefinition buildNewComponentDialog()
throws ActionExecutionException, RepositoryException {
ConfiguredFormDefinition form = new ConfiguredFormDefinition();
ConfiguredTabDefinition tab = new ConfiguredTabDefinition();
tab.setName("versions");
SelectFieldDefinition select = new SelectFieldDefinition();
select.setName(VersionName.PROPERTY_NAME_VERSION_NAME);
select.setSortOptions(false);
tab.addField(select); //more code follows
}
@Override
protected Node getNode() throws RepositoryException {
return nodeAdapter.getJcrItem();
}
protected String getVersionName() {
return (String) getItem()
.getItemProperty(VersionName.PROPERTY_NAME_VERSION_NAME)
.getValue();
}
/**
* Simple POJO used to access user selection from dialog,
* see {@link com.vaadin.data.util.BeanItem}.
*/
protected class VersionName {
protected final static String PROPERTY_NAME_VERSION_NAME = "versionName";
private String versionName;
public String getVersionName() {
return versionName;
}
public void setVersionName(String versionName) {
this.versionName = versionName;
}
}
}
最佳答案
这意味着注入(inject)到 fieldFactory 的项找不到 defition#name 的属性。在您的情况下, defition#name 是 versionName ,为了不让 fieldFactory 一起失败,它会回退到默认值。我将调试哪个字段是导致此行为的原因,并从那里继续调查。
希望有帮助,
干杯
关于java - Magnolia 日志中的 AbstractFieldFactory 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59882958/
我调用这个ImportCommandAction它被定义为公共(public)类 ImportCommandAction extends AbstractVersionAction作为页面上的操作。
我是一名优秀的程序员,十分优秀!