1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    5
    Vote Rating
    0
    roberto35 is on a distinguished road

      0  

    Default ListView getTemplate Byte img

    ListView getTemplate Byte img


    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 imagesas 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.

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Jul 2011
    Posts
    5
    Vote Rating
    0
    roberto35 is on a distinguished road

      0  

    Default


    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...

Thread Participants: 1

Tags for this Thread