Results 1 to 5 of 5

Thread: Question marks displayed in list instead of images

  1. #1

    Default Answered: Question marks displayed in list instead of images

    Hi,

    I'd like to display images in a list so I use a template with the <img> tag. The URL for the image is right and I can display the image in my (Android) device browser using this URL but somehow question marks are displayed in the list instead of the actual images. I'm using Phonegap 1.2.0 by the way.

    Here's my code :

    Code:
    app.views.DealsListCard = Ext.extend(Ext.Panel, {
        title: 'Deals',
        iconCls: 'favorites',
        cardSwitchAnimation: 'slide',    
        dockedItems: [{
            xtype: 'toolbar',
            title: 'Deals',
            items: [
                    {
                        text: 'Filter'
                    },
                    { xtype: 'spacer' },
                    {
                        text: 'Store'
                    }
                ]
        }],
        layout: 'fit',
        items: [{
            xtype: 'list',
            store: app.stores.deals,
            itemTpl: '<img width="66" height="66" src="{PU}"/><div>{PU}</div>',
        }],
        initComponent: function() {
            app.views.DealsListCard.superclass.initComponent.apply(this, arguments);
        }
    });
    
    Ext.reg('dealslistcard', app.views.DealsListCard);
    PU = image URL and it's displayed properly as text in my list.

    Cheers,

    Pierre

  2. In phonegap you have to use full url and you need to whitelist the server you are connecting to (this can be a wildcard as well). This is done in your PhoneGap.plist file. From the Phonegap docs:
    Also, the latest code has the new white-list feature. If you are referencing external hosts, you will have to add the host in PhoneGap.plist under the "ExternalHosts" key. Wildcards are ok. So if you are connecting to "http://phonegap.com", you have to add "phonegap.com" to the list (or use the wildcard "*.phonegap.com" which will match subdomains as well)

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449
    Answers
    3997

    Default

    If you are getting the question mark icon, then the url is not correct.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #3

    Default

    Quote Originally Posted by mitchellsimoens View Post
    If you are getting the question mark icon, then the url is not correct.
    That's what I thought but the URL is displayed in plain text in the list and it seems to be correct. I also tried to copy and paste this URL in my device browser and the image is displayed properly. And if I put a static URL directly in the code I still have a question mark...

    Cheers,

    Pierre

  5. #4
    Sencha User
    Join Date
    Aug 2010
    Posts
    315
    Answers
    4

    Default

    In phonegap you have to use full url and you need to whitelist the server you are connecting to (this can be a wildcard as well). This is done in your PhoneGap.plist file. From the Phonegap docs:
    Also, the latest code has the new white-list feature. If you are referencing external hosts, you will have to add the host in PhoneGap.plist under the "ExternalHosts" key. Wildcards are ok. So if you are connecting to "http://phonegap.com", you have to add "phonegap.com" to the list (or use the wildcard "*.phonegap.com" which will match subdomains as well)

  6. #5

    Default

    Quote Originally Posted by steve1964 View Post
    In phonegap you have to use full url and you need to whitelist the server you are connecting to (this can be a wildcard as well). This is done in your PhoneGap.plist file. From the Phonegap docs:
    Also, the latest code has the new white-list feature. If you are referencing external hosts, you will have to add the host in PhoneGap.plist under the "ExternalHosts" key. Wildcards are ok. So if you are connecting to "http://phonegap.com", you have to add "phonegap.com" to the list (or use the wildcard "*.phonegap.com" which will match subdomains as well)
    Thanks. I don't know if the issue was related to this whitelist or my proxy but if I put the images on a local web server it works. By the way on Android you have to modify the phonegap.xml file and the tag looks like <access origin="http://127.0.0.1*"/>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •