cancel
Showing results for 
Search instead for 
Did you mean: 

how to display image in view

Former Member
0 Kudos

Hi ,

I want to display an image in my one of the views?? How to do it??

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi kavita,

You can achive this using the image UI.

Insert the image UI in the corresponding view.

1. Import the image to ur project

src->mimes->components->(package) -><file.jpg>

2.Set the image UI properties

alt-><file.jpg> Or use a context

source-><file.jpg> or context.

Regards

karthik.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Kavita,

1. Copy your image from local machine.

2. Open Navigator view of your project and navigate to the folder

<project>>src>mimes>Components><name of the component along with package>

Paste your image over here

3. Insert an Image UI element in your view.

4. Set its imageSource property to the name of the image that you pasted in the folder in step2 along with its extension and remember name is case sensitive.

5. Build your application.

6. Deploy and run.

Regards,

Murtuza

Former Member
0 Kudos

Hi,

First Keep your image in Sample.jpg in c:\program files\<installation directory>\src\mimes\components\<ur component name>\Sample.jpg

U can display .JPG,.BMP,.GIF

1)Insert Image UI element

2)create an attribute IMAGE and set calculated=True in attribute properties

3)It generate two methods getImage() and setImage() methods

4)Bind the image attribute to image UI element

5)write the following coding in

getImage()

{

return "sample.jpg"

}

6)u have to specify the Image name correctly if it is in uppercase or lowercase

Otherwise,

Insert Image UI element then click image properties---->Source=Sample.jpg

Directly u type the image name Sample.jpg in that source and press Enter,automatically it will bind with tickmark. Then deploy it works...

Regards,

Suresh.T

former_member485701
Active Participant
0 Kudos

Hi Kavita,

Go to the Navigator tab and open the project.

copy the image to src->mimes->components->componentFolder->

Go to your view and add an image UI element here.

go to the property "source" and then click on browse and select the component image.

Feel free to ask queries.

Regards,

Praveen

Former Member
0 Kudos

Hi Kavitha

first copy XX.gif into "project/src/mimes/components/<packagename>"

1) First insert a Child "Image" UI Element

2) Create a Context in a view in which you are using Image UI Element

3) Value Node

Name : Image

Cardidality : 1..1

4) create 2 Value Attributes

4)a ImageAlt (Calculate property - true)

4)b ImageSrc (Calculate property - true)

5)Bind the properties of Image

alt - Image.ImageAlt

source - Image.ImageSrc

6) in getImageSrc()

{

retrun "XX.gif"

}

7) in getImageAlt()

{

return "Image Not Available"

}

Regards

Chaitanya.A