Chuyển đến nội dung chính

Image is not showing up on Dialog.

I am getting problem with Dialog. In my Dialog I have created the image field which accepts image from dam by Drag and drop. Whil Iam dropping the image it is showing up inside the Dialog properly and is showing up on the screen also But when I try to edit the image the current image got vanished inside the dialog. I don't understand why it is happening?

Here is the example of configuration of an image on the tab of dialog.

<backImage
jcr:primaryType="cq:Widget"
cropParameter="./backImage/imageCrop"
ddGroups="[media]"
fileNameParameter="./backImage/fileName"
fileReferenceParameter="./backImage/fileReference"
mapParameter="./backImage/imageMap"
name="./backImage/file"
requestSuffix="/backImage.img.png"
rotateParameter="./backImage/imageRotate"
sizeLimit="100"
title="Background Image"
xtype="html5smartimage"/>




You need to create a hidden property in order to be able to edit the image. Create a node below your image node and set a hidden property. You can refer :

/libs/foundation/components/textimage/dialog/items/tab3/items/resType
e.g.
<items jcr:primaryType="cq:WidgetCollection">
                    <resType
                        jcr:primaryType="cq:Widget"
                        ignoreData="{Boolean}true"
                        name="./sling:resourceType"
                        value="foundation/components/image"
                        xtype="hidden"/>
                </items>


Now the config of image will be:

<backImage
jcr:primaryType="cq:Widget"
cropParameter="./backImage/imageCrop"
ddGroups="[media]"
fileNameParameter="./backImage/fileName"
fileReferenceParameter="./backImage/fileReference"
mapParameter="./backImage/imageMap"
name="./backImage/file"
requestSuffix="/backImage.img.png"
rotateParameter="./backImage/imageRotate"
sizeLimit="100"
title="Background Image"
xtype="html5smartimage">
<items jcr:primaryType="cq:WidgetCollection">
<resType
jcr:primaryType="cq:Widget"
ignoreData="{Boolean}true"
name="./backImage/sling:resourceType"
value="foundation/components/image"
xtype="hidden"/>
</items>
</backImage>

Nhận xét