View Full Version : rendering images on a view
arunarao
02-10-2006, 02:42 AM
Hello all,
The data held in a dataset can be rendered using a datapath attribute.
In a similar way if i want to render a set of images on a view within my application, can i use a dataset for this. If so how, If not is there any other way to do this.
Thanks,
jstretch
02-10-2006, 10:42 AM
Have you tried something like:
<dataset name="images">
<image>test1.jpg</image>
<image>test2.jpg</image>
<image>test3.jpg</image>
</dataset>
<view datapath="images:/image" resource="$path{'text()'}" />
arunarao
02-12-2006, 08:02 PM
I tried this way, but images are not displaying.
I have put the images in a folder named images and have put this and the lzx application under my-apps folder. I tried changing many things, but not working
Any solution plz help.. Thanks
caclark
02-13-2006, 06:21 AM
IIRC, the values for the image must be relative to the LZX you're running OR must be a fully qualified URL just like you'd type in a browser address bar.
jstretch
02-13-2006, 06:23 AM
<dataset name="images">
<image>images/test1.jpg</image>
<image>images/test2.jpg</image>
<image>images/test3.jpg</image>
</dataset>
<view datapath="images:/image" resource="$path{'text()'}" />
You may want to post some source code so we can better help you.
Shelby
02-14-2006, 01:43 PM
FYI, I have seen Antun post that it is a bad idea to dynamically set the resource attribute to external media. Instead, overwrite the applyData method and use the setSource function. I believe resource is designed for internally compiled resources using <resource>. I could be wrong, so take this for what its worth to you.
<dataset name="images">
<image>images/test1.jpg</image>
<image>images/test2.jpg</image>
<image>images/test3.jpg</image>
</dataset>
<view datapath="images:/image">
<method name="applyData">
this.setSource(this.data);
</method>
</view>
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.