Skip to Content
avatar image
Former Member

inserting an image in a view

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 !

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 29, 2006 at 09:52 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 29, 2006 at 06:30 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • avatar image
    Former Member
    Dec 29, 2006 at 09:44 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 29, 2006 at 09:58 AM

    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

    Add comment
    10|10000 characters needed characters exceeded