无法在AEM对话框中显示图像 [英] Not able to show image on dialog box in AEM

查看:97
本文介绍了无法在AEM对话框中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个带有图像预览的对话框。我能够创建所有字段的对话框,但我面临的问题与图像。我已经看到了图像组件,您可以拖放放映图像,但是当我打开对话框组件时,我需要显示图像。是否有任何组件为此没有拖放。

I am trying to create a dialog with image preview on it. I am able to create dialog with all the fields but i am facing issue with image. I have seen the image component where you can drag drop image but i need the image to be shown when i open dialog component. Is there any component for this without drag drop.

我尝试过html5smartimage图像,但不工作。请参阅以下代码:

I have tried with html5smartimage image but not working. Please see code below:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
height="{Long}500"
title="Test Dialog"
width="{Long}800"
xtype="dialog">
<items
    jcr:primaryType="cq:Widget"
    xtype="tabpanel">
    <items jcr:primaryType="cq:WidgetCollection">
        <tab1
            jcr:primaryType="cq:Panel"
            title="Component Details">
            <items jcr:primaryType="cq:WidgetCollection">
                <image
                    jcr:primaryType="cq:Widget"
                    cropParameter="./imageCrop"
                    ddGroups="[media]"
                    fileNameParameter="./fileName"
                    fileReferenceParameter="./fileReference"
                    mapParameter="./imageMap"
                    name="./file"
                    requestSuffix=".img.png"
                    rotateParameter="./imageRotate"
                    title="Image"
                    xtype="html5smartimage">
                    <icon.png jcr:primaryType="nt:file">
                        <jcr:content
                            jcr:data="{Binary}"
                            jcr:lastModified="{Date}2015-07-28T19:27:46.878+05:30"
                            jcr:lastModifiedBy="admin"
                            jcr:mimeType="image/png"
                            jcr:primaryType="nt:resource"
                            jcr:uuid="754c14c8-4423-45df-b982-06bfc13dc6e3"/>
                    </icon.png>
                </image>
            </items>
        </tab1>
    </items>
    </items>
</jcr:root>

请帮助我解决这个问题。

Please help me out on this.

推荐答案

如果你想做的是所有,我不认为需要使用 html5smartimage ,显示静态图像在对话框中(不需要提交)。

I don't think there is a need to use the html5smartimage if all that you want to do is, display a static image in the dialog (which needn't get submitted too).

可以使用xtype displayfield ,并使用 html 属性,如下所示。

You can make use of the xtype displayfield and use the html property as shown below.

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0"
    xmlns:jcr="http://www.jcp.org/jcr/1.0" 
    xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    jcr:primaryType="cq:Dialog"
    height="{Long}500"
    title="Test Dialog"
    width="{Long}800"
    xtype="dialog">
    <items
        jcr:primaryType="cq:Widget"
        xtype="tabpanel">
        <items jcr:primaryType="cq:WidgetCollection">
            <tab1
                jcr:primaryType="cq:Panel"
                title="Component Details">
                <items jcr:primaryType="cq:WidgetCollection">
                    <displayimage jcr:primaryType="cq:Widget" 
                        html="<img src='/content/dam/geometrixx/icons/target.png'>" 
                        xtype="displayfield" />
                </items>
            </tab1>
        </items>
    </items>
</jcr:root>

将图像替换为 src 您要在对话框中显示的图像。

Replace the image src with the path to your image which you want to display in the dialog.

这篇关于无法在AEM对话框中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆