on 07-11-2007 12:13 PM
The project is about keeping track of employee records.Each employee has a image.These images are saved on the server at a specified location i.e. <b>c:\images\</b>.This path along with other details are saved in the database.
While viewing the details of the employee in another view, his/her image should be displayed.
So my question is how to set image to the image UI Element?
HI Sowmya,
Let the image source variable be <b>"Img".</b>
Here I am assuming that u want to display Sowmya.jpg from C:\Images in server.
Do the following.
File f=new File("C:
Images
Sowmya.jpg");//File name is Case sensitive
FileInputStream fis=new FileInputStream(f);
byte b[]=new byte[fis.available()];
fis.read(b);
IWDResource res=WDResourceFactory.createCachedResource(b,"Sowmya.gif",WDWebResourceType.UNKNOWN);
String url=res.getUrl(1);//GETTING URL OF IMAGE FROM SERVER
wdContext.currentContextElement().setImg(r);//SETTING IMAGE SOURCE
Regards
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Pl go through this blog
/people/anilkumar.vippagunta2/blog/2007/02/20/reading-and-writing-images-from-sqlserver-in-webdynpro
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must put the images in a folder that is accessible via the Web AS or put them into a deployment unit. In either case, the Image UI element needs the URL to the image as value of its "source" property.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sowmya,
Add two value attributes ( ImgSource) to
the value node for image.Make it calculated.In getter u can access the employee id or other details & set the source accordingly(Any how u r goin to get the source from the database.
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.