PDA

View Full Version : ListView getTemplate Byte img



roberto35
30 Aug 2011, 11:41 AM
Hello,
What a title!!
I want to save some product images inside a database, i would like to display them such as a listview could do.
My problem is, at the end, i have such things for displaying images:(as this, it is working for text only)
If possible i don't want to use img reference to a filesystem path.



ListView<BeanModel> lview = new ListView<BeanModel>();
lview.setTemplate(getTemplate());
lview.setStore(store);




private native String getTemplate() /*-{
return [ '<tpl for=".">', '<div >',
'<div class="description">{description}</div>',
'<div class="price" >{price}</div>', '</div>', '</tpl>', '' ].join("");
}-*/;


But how can i handle an image as byte with this, is there a way to do it?

Thanks.
Regards.

sven
30 Aug 2011, 11:47 AM
My problem is, at the end, i have such things for displaying imagesas this, it is working for text only)
If possible i don't want to use img reference to a filesystem path.


filesystem path wont work, it has to be accessible over http.



But how can i handle an image as byte with this, is there a way to do it?



Newer browsers support data urls, however if you need to support IE6 and IE7 too or old Firefox versions, than this wont be a solution either.

roberto35
30 Aug 2011, 11:57 AM
ok so i have to use <img ref="myimageservleturl?image=productid">...?
what do you think of such a method? Is it a nice solution?
but it does multiple acces...