cancel
Showing results for 
Search instead for 
Did you mean: 

inserting an image in a view

Former Member
0 Kudos

Hello,

I tried inserting an image using Image UI element in a view by copying that image in " <b>src\mimes\components\<comp> "</b>. I get to see the image at design time.

But when I deploy this WD application the image doesnot appear. A cross mark is displayed instead.

Is anything wrong with this method? Do correct me.

Please do tell me more methods to add an image to a view.

Thanks !

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Have a look at the HTML source and find the &lt;img> tag representing the image. What URL does it have? Can you open that URL in a browser alone?

Armin

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Create image UI element. Select properties for the image UI element and give the filename.jpg or filename.gif for alt and source property.

Regards

Suresh

Former Member
0 Kudos

Prasanna,

One of the ways to display Image to a view is :

1. Create a context (value attribute) element "image" of string type.

2. Insert a Child of type "IMAGE" into the View.

3. Select the property "SOURCE" for the image as context element "image"

4. under the wdDoInit method paste the below code :

wdContext.currentContextElement().setImage("<image.extn>");

This <image.extn> file should be uploaded under "src\mimes\components\<comp>"

Hope this works out for u.

Best Regards,

-Prashant.

Former Member
0 Kudos

Hi Prasanna,

When u r givin the image in view, u have see into the <b>property</b> of view where u need to click on <b>browse</b> to get th exact location. <u><b>A tick mark</b></u> will come next to the <b>source</b> r <b>id</b>. Check this.

Regards,

Deepti

Former Member
0 Kudos

I tried this earlier !

I already set the image property to 'source'. A tick is also displayed.

But it doesnt show the image when the WD application is run.

Former Member
0 Kudos

Hi,

It is not needed to give the full path of the image. Just the image name with the extension should do.

Check the extension type of ur image. What is the type of image u r trying to show in ur view?

- Nagarajan.

Former Member
0 Kudos

Hi Prasanna,

Check your image size. Try with small images.. Dont try to use Bigger image size. Reduce your image size and see. Dont give the full path. If your image name is pict.jpg.. then specify the path as pict.jpg.

Hope it helps you.

Thanks & Regards,

Dhana

Former Member
0 Kudos

Mine's a JPEG image. Wat are the other image types supported ?

Thanx for ur reply !

Former Member
0 Kudos

Thnx for ur reply !

Actually my image size is 210 x 67 n other one has 152 x 135.

Is the image UI restricted by image size ?

Former Member
0 Kudos

Hi Prasanna,

I am not sure about that.. But i had a same problem. When I reduced my image size to 98 X 87, it got displayed. so try reducing ur image size and let me know Prasanna.

Thanks & Regards,

Dhana

Former Member
0 Kudos

Prasanna,

Size shouldn't be an issue because we have tried with larger images. 1 possible reason could be u might have given a image name in the source and deployed it first. Then changed a different image. After this deployment the server references the previous image name. Caching might have happened.

So one possible work around may be take the same picture and rename it. Then copy and paste the renamed image in the appropriate folder. In the source property just give the newly renamed name of the image.jpeg.

- Nagarajan.