Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/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
HTML5 SmartImage上的“清除”按钮是什么_Image_Aem - Fatal编程技术网

HTML5 SmartImage上的“清除”按钮是什么

HTML5 SmartImage上的“清除”按钮是什么,image,aem,Image,Aem,我继承了一个包含HTML5 SmartImage组件的脚手架表单。这用于允许用户为此页面选择显示图像 (我知道这不是该组件的设计目的,但我不知道用户正在使用什么功能,我们正在指定高度。) 以下是配置信息: <featuredImage jcr:primaryType="cq:Widget" allowUpload="false" ddGroups="[media]" disableZoom="{Boolean}true

我继承了一个包含HTML5 SmartImage组件的脚手架表单。这用于允许用户为此页面选择显示图像

(我知道这不是该组件的设计目的,但我不知道用户正在使用什么功能,我们正在指定高度。)

以下是配置信息:

    <featuredImage
        jcr:primaryType="cq:Widget"
        allowUpload="false"
        ddGroups="[media]"
        disableZoom="{Boolean}true"
        fileNameParameter="./jcr:content/data/image/fileName"
        fileReferenceParameter="./jcr:content/data/image/fileReference"
        name="./jcr:content/data/image"
        title="Featured Image"
        height="400"
        xtype="html5smartimage"/>

添加图像时,会有一个带有画笔图片的清除按钮,用于清除某些内容。我假设它是用来清除图像的,但它总是被禁用的

我在任何文档中都找不到此清除按钮

根据下面的答案,我构建了以下解决问题的方法:

    <featuredImage
        jcr:primaryType="cq:Widget"
        allowUpload="false"
        ddGroups="[media]"
        disableZoom="{Boolean}true"
        fileNameParameter="./jcr:content/data/image/fileName"
        fileReferenceParameter="./jcr:content/data/image/fileReference"
        name="./jcr:content/data/image"
        title="Featured Image"
        height="400"
        xtype="html5smartimage">
      <listeners
        jcr:primaryType="nt:unstructured"
        imagestate="function(imageComponent, state) {
                      if(state == 'originalavailable' || state == 'processedavailable') {
                          imageComponent.enableToolbar();
                      }
                    }"/>
    </featuredImage>

我在使用自定义小部件而不是scaffold表单时遇到了类似的问题。不过,修复程序也应该适用于此

将侦听器添加到图像中,如下所示

listeners: {
    imagestate: function(imageComponent, state) {
        if(state == 'originalavailable' || state == 'processedavailable') {
            imageComponent.enableToolbar();
        }
    }
}

这将在您将图像放入对话框时启用“清除”按钮。

我已经用代码编辑了我的问题,因为我认为应该添加代码,但没有骰子。当你说“添加到你的图像”时,如何添加?