on 10-27-2005 1:52 PM
Hello,
At WDRuntime on the click of the Connect button I am picking the images form MDM, and storing in the src/mimes/<component name> directory. I am storing the location / name of the image in the valueattribute of the context. While picking the data and images from MDM, records are added to the table and displayed except the Images. Images are not being displayed in the first attempt.
Any ideas???
Best regards,
Dharmi
Do you see the "missing image" placeholder in the browser? Right-click it and have a look at the URL? How does it look like?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Armin,
Yes I see the missing image placeholder. The url looks like this:
and by trying the other way where i wouldn't get the image in t13/0000000 the url looks like below:
But that does not make a difference.
If i run this application after closing the NWDS and deploying it again it shows the images.
Regards,
Dharmi
Hello Armin,
At the connect button the images are picked from MDM, stored in the location of "mimes" and also displayed in the table.
For e.g. If the MDM catalog had 100 records and if I picked only 25 for testing, the images are not displayed you see only the image placeholder. I close the application by exiting the NWDS. I restart NWDS and now I try to pick 50 records, deploy and run , I see the first 25 images and for the next 25 I see again the image placeholder.
Hope the above is clear.
Best regards,
Dharmi
Hello Armin,
For yor application to display the images; the image has to be placed in the mimes/components/<xxxx> folder. This is were my images get stored.
Below is the code:
A2iValueArray imgs1 = rs.GetValueAt(i,"Images").GetValueArray();
if (imgs1 != null)
{
for (int j = 0; j < imgs1.GetCount(); j++)
{
<i>// GetBlob is the method in the Java API to pick the image from the MDM Product catalog.</i>
byte[] bImage = cd.GetBlob("Images", imgs1.GetValueAt(j).GetIntValue(),false);
try {
<i>//This is were the image is saved after being loaded</i>
FileOutputStream fs = new FileOutputStream("C:
Documents and Settings
Dharmi.Tanna
Documents
SAP
workspace
WDMDMTestprj
src
mimes
Components
com.sap.mdmtest.comp.MDMTestComp
Orgimg"i".jpg") ;
fs.write(bImage);
fs.flush();
fs.close();
<i>//This is were i am assigning the imageloaction to the node which is used to diaplay the table.</i>
ResultSetElement.setImage("Orgimg"i".jpg");
} catch (FileNotFoundException e) {}
catch (IOException e) {}
}
}
Regards,
Dharmi
From your code I see that you store the images on your client (where NWDS is installed).
To get them deployed on the server, you have to do the "refresh" as described and then redeploy the application. The "refresh" brings Eclipse in synch with the new content of the local filesystem such that new images are included in your project.
Apart from this: Is this only a testing scenario?
Armin
Hello Armin,
Yes, at this moment it is a testing scenario. Later on a web shop would be developed.
I tried the "refresh" and redeployed the application but this saves me of not exiting the NWDS and redeploying it.
The problem of it not displaying in the first run still remains. (This is the moment when the above codes is run for the very first time when there are no images in the mentioned location).
Regards,
Dharmi
p.s. Do let me know if you would like to see the screenshot of the same?
Message was edited by: Dharmi Tanna
I concluded from your description that you have one (local) application that first loads the images into mimes folder of a second application.
Then my proposal "refresh/rebuild/deploy/run" the second application after loading the images should work.
Why not loading the images directly onto the server and setting the image URL to take them from there?
Armin
I see. But you have to put the images into the server's storage area and not into your NWDS project to be able to show them with your application.
For testing, identify the folder where the images are stored on the server and let your application put them therein.
You don't have to use the mimes folder of the component but this simplifies the URL calculation (simply use image file name).
I hope this finally solves the problem.
Armin
Hello Armin,
Thanks a lot for all the help.
Nope the problem still remains <b>partly</b>.
In the first run I do see images for most of my records but <b>not for all</b> records (image place holder). I checked for the image (where there is just the image placeholder), and I do see the image in the server location but not on my WD application.
Best regards,
Dharmi
Hello Armin,
- when are the images loaded, in an event handler?
Images are loaded when a connect button is clicked.
- how is the Image.source property bound?
In the view context I have a valueNode for each column of the table and for image it is the Image value attribute (String) and Source of the image is bound to this value attribute.
- are you using a table to display the images?
Yes, I am using table to display the images
- what is the content of the mimes folder on the server before/after loading the images?
The mimes folder of the application is empty before/after loading the image. I am saving the images on the server on the c:/Temp/ImageCache.
Best regards,
Dharmi
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.