on 04-20-2006 2:55 PM
Hi All,
I would like to display an image with Web Dynpro.
I already know how to display an image which is stored in the path src/mimes/Components/...
But does anybody knows, how to display an image which is stored in a database (e.g. MaxDB)as a datatype of binary?
Thanks in advance!
Regards,
Silvia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello Bertram,Silvia
I am trying to display an image dynamically from the portal database to
table in webdynpro.I worked on the above solutions.but which is the UI element to be used
for binding stramed byte from the context.I used "FileDownload UI",but it displays only
when it is clicked on the link.Can we use "Image UI element for binay stream?when the view is displayed it should show the image automatically.
if so ,how can it be done?
regards
John
Hallo John,
yes, you can use the Image UI element.
Further you have to create a String for the URL. Implement like as follows:
IWDCachedWebResource cachedResource = null;
String imgUrl = null;
WDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute(IPrivateXYView.IXYElement.PIC_DB);
IWDModifiableBinaryType binaryType =
(IWDModifiableBinaryType) attInfo.getModifiableSimpleType();
binaryType.setMimeType(WDWebResourceType.JPG_IMAGE);//Example *.jpg
WDWebResourceType type = binaryType.getMimeType();
byte[] file = wdContext.currentXYElement().getPicDB();
if (file != null)
{
cachedResource = WDWebResource.getWebResource(file, type);
try
{
imgUrl = cachedResource.getURL();
}
catch (WDURLException e)
{
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException(e.getLocalizedMessage(), true);
}
}
I hope it will help you.
Regards,
Silvia
User | Count |
---|---|
84 | |
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.