cancel
Showing results for 
Search instead for 
Did you mean: 

Showing Images

Former Member
0 Kudos

Hi Guys,

I have try to show images in my web dynpro. I have read on how to do it and it shows in my developer studio,but it don't shows on my webpage when I run that application. Does anyone knows why? Thanks.

Regards,

C

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi You have to place your Image in the following folder of your project/src/mimes/components/<component>/imagename

donot forget to put your image name correctly,don't include extension jpeg letus say if ur putting clouds.jpeg, just give name as clouds and copy on to the folder structure, while giving name to your dynpro image source name give clouds.jpg it will work..

Former Member
0 Kudos

If you import the image files in NWDS into folder src/mimes/components/<your_component>, then you can use the image file name for properties like "Image.source".

Did you do that?

Armin

Former Member
0 Kudos

Yes I did that. On my Developer Studio, its ok, but when I deploy and run, the image is missing. I have checked the server and the file is there.

source: clould.png

Former Member
0 Kudos

Can you give more information: Which UI element, how is the image set (via setting or binding against context), which service pack, ...

Armin

Former Member
0 Kudos

I am using sp7. I am using UI element Image.

Properties:

alt : X

border: 0

enabled: true

height:

id: WelcomeImage

source: clould.png

tooltip: <>

visible: visible

width:

All the rest is set at none.

Thanks.

Regards,

Conrad Chia

Former Member
0 Kudos

Perhaps your browser cannot display the PNG correctly? Also, you could have a look at the HTML source and look for the corresponding <img> tag (search for the image ID). Can you post this piece of HTML here?

Armin

Former Member
0 Kudos

<img class="urImg urV" src="/webdynpro/resources/local/WebDynpro_Basics/Components/com.sap.tc.webdynpro.tutorials.introduction.basics.FirstComponent/clould.jpg" id="ECCF.FirstComponentView.WelcomeImage" ct="Image" border="0"></span></div></td></tr></table></span></div><table border="0" cellpadding="0" cellspacing="0" class="urSTbvStd"><tbody><tr><td><table cellpadding="0" cellspacing="0" id="WD_MessageBar" ct="TableView" width="100%" nmi="0" style="empty-cells:show;"><tbody></table></td></tr></table>

I have change the image to a jpg one, also cannot. The code tag is above. Thanks.

Regards,

Conrad

Former Member
0 Kudos

Looks ok to me. At the beginning of the HTML page, you find a <base>-tag. If you resolve the URL in the <img>-tag relative to the base URL and enter the resulting URL into the browser address field, do you get the image displayed?

Armin

Former Member
0 Kudos

Do you mean by keying in the address like

'http://mysapxia:50000/webdynpro/resources/sap.com/tcwddispwda/global/SSR/'?

I only get the error message '403 Forbidden'.

Conrad

Former Member
0 Kudos

Yes. Append the image URL to this base URL and check if you can load the image.

Another question: Why is the hostname not fully qualified?

Armin

Former Member
0 Kudos

Hi Armin

I am sorry for asking so many questions, but I am new to this. Have never done Java for a long long time. Do I need to activate settings on my server also?

Sorry, what do u mean by hostname not fully qualified? I am using my company's server.

I have tried to add clould.jpg at the end but it still does not show.

I also have add the "/webdynpro/resources/local/WebDynpro_Basics/Components/

com.sap.tc.webdynpro.tutorials.introduction.

basics.FirstComponent/clould.jpg"

at the end, also cannot.

Hi Ramakrishna,

I have also tried your solution, also cannot.

Former Member
0 Kudos

Strange. Perhaps there is some other problem in your application. Are there any errors in the task view?

You could try to reduce the problem and create a simple test application with one single view containing only an Image UI element.

- Import the image file into the mimes folder of the component (as described)

- Set the "source" property of the Image UI element to the filename (<b>including</b> the extension ".png" or ".jpg")

- Rebuild the project

- Deploy and run the application

Does it work?

Armin

Message was edited by: Armin Reichert

Former Member
0 Kudos

Sorry, it does not work too. I have another problem, I did the extended Web Dynpro application, I got an error which says that the file Answer.properties cannot be found. Is there a setting in the J2EE server or some other server that needs to be set? It seems like all the files in the folders cannot be seen.

Regards,

Conrad

Former Member
0 Kudos

What exactly did not work? Was the application started at all? Please give more details.

Do you get errors in the deployment console?

Armin

Former Member
0 Kudos

The application can't start because the system can't find the file Answer.properties . There are no errors in the deployment console.

error : 'java.util.MissingResourceException: Can't find bundle for base name com.sap.tc.webdynpro.tutorials.quiz.resources.Answers, locale en_US

at java.util.ResourceBundle.throwMissingResourceException

(ResourceBundle.java:839)'

That's the error I have went I try to run my other application. This got me thinking whether there is a setting on the server that I need to set for them to see the files? Cos like the image file, this text file also cannot be found.

Conrad

Message was edited by: Conrad Chia

Former Member
0 Kudos

Please do not mix two problems in this thread, this confuses things. Did the simple test app with a single image work? If not, why not?

Armin

Former Member
0 Kudos

Ok. I already test what u ask me to do, but the image don't seem to appear. There is no error when I build the application and when I deploy and run, there is also no error. I have looked in the j2ee server and I can see the files there.