Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.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
Adobe AEM editContext为空_Adobe_Aem - Fatal编程技术网

Adobe AEM editContext为空

Adobe AEM editContext为空,adobe,aem,Adobe,Aem,我已经创建了一个组件,我想根据“编辑”对话框中给定的值在工具栏中添加一些内容 当我来到页面editContext时,它给出了适当的值 // value is a string that i am reading from edit dialog field if (editContext != null && editContext.getComponent() != null && value != null) { editContext.get

我已经创建了一个组件,我想根据“编辑”对话框中给定的值在工具栏中添加一些内容

当我来到页面editContext时,它给出了适当的值

// value is a string that i am reading from edit dialog field

if (editContext != null && editContext.getComponent() != null && value != null) {
       editContext.getEditConfig().getToolbar().add(new Toolbar.Label(value)); 
}
这段代码是用jsp编写的,如果条件为true,但当我在对话框中单击edit并更改某些内容时,我的组件被刷新(而不是整个页面),现在editContext给了我null。如果我再次刷新页面,它就可以正常工作


如果我在编辑后添加侦听器以刷新父级或整个页面,它可以正常工作,但我不想这样做。

您为组件定义了cq:EditConfig吗?是的,我为组件定义了cq:EditConfig吗?您为组件定义了cq:EditConfig吗?是的,我为组件定义了cq:EditConfig