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

      0  

    Question Unanswered: Button text blank: Sench Touch/Phonegap Contact Example

    Unanswered: Button text blank: Sench Touch/Phonegap Contact Example


    I worked my way through the excellent tutorial on creating a contact list app with Sencha Touch and Phone Gap, and when I try to add a button to the ContactDetails.js page, it works great the first time the details page shows, but the button is blank any time the page is shown after that.

    I tried the same thing with the code from GitHub with the same results.

    Here's where I added my (very simple) code.

    Code:
        items: [
            {xtype: 'button', text: "Test button"},
            {tpl:[
    '<h4>Phone</h4>',
    '<tpl for="phoneNumbers">',
    '<div class="field"><span class="label">{type}: </span><a href="tel:{value}">{value}</a></div>',
                '</tpl>'
            ]},
            {tpl:[
    '<h4>Email</h4>',
    '<tpl for="emails">',
    '<div class="field"><span class="label">{type}: </span><a href="mailto:{value}">{value}</a></div>',
                '</tpl>'
            ]},
            {tpl:[
    '<h4>Search</h4>',
    '<div class="field"><span class="label">Google: </span><a href="http://www.google.com/m/search?q=%22{givenName}+{familyName}%22">\'{givenName} {familyName}\'</a></div>',
    '<div class="field"><span class="label">Bing: </span><a href="http://m.bing.com/search?q=%22{givenName}+{familyName}%22">\'{givenName} {familyName}\'</a></div>',
            ]}
        ],
    Any ideas why the button is blank, or more importantly how to fix it? I'm stumped.

  2. #2
    Touch Premium Member
    Join Date
    Mar 2011
    Location
    New Jersey, USA
    Posts
    130
    Answers
    4
    Vote Rating
    0
    jjerome is on a distinguished road

      0  

    Default


    it looks like you are using an array of templates for each tpl config. dont use the [ ]'s and commas, if you want to create a multiline tpl like that, use +'s to concatenate it all.

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

      0  

    Default


    That's helpful, thank you. I'll concatenate and see if that makes a difference.

    If this is the solution, the tutorial should be updated to reflect this. I'll let everyone know if this helps.

    Thanks jjerome.

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Posts
    5
    Vote Rating
    0
    JoeKueser is on a distinguished road

      0  

    Default


    Unfortunately concatenating the tpl didn't make any difference in the button rendering. Though it does appear that the page renders marginally faster (this may be my imagination)

  5. #5
    Sencha User
    Join Date
    Dec 2011
    Posts
    4
    Vote Rating
    1
    Jiawei Yong is on a distinguished road

      0  

    Default Any solution?

    Any solution?


    Hi Joe,

    Have the same problem as you. Any workaround/solution for this issue?

  6. #6
    Sencha User
    Join Date
    Mar 2007
    Posts
    38
    Vote Rating
    2
    JoeK is on a distinguished road

      0  

    Default


    No, sorry. I couldn't figure it out, and nobody was able to help, so I moved on to a different framework.

  7. #7
    Sencha User
    Join Date
    Dec 2011
    Posts
    4
    Vote Rating
    1
    Jiawei Yong is on a distinguished road

      0  

    Default


    Hi Joe,

    This is probably too late for you, but just for reference, think I found the problem.

    If you have strictly followed the example and have this in your code


    updateWithRecord: function(record) { Ext.each(this.items.items, function(item) { item.update(record.data); }); var toolbar = this.getDockedItems()[0]; toolbar.setTitle(record.get('givenName') + ' ' + record.get('familyName')); toolbar.getComponent('edit').record = record;}
    What's going to happen is that your button will be among the items updated. And logically a button does not fit in with your data model so text goes missing. Maybe you should try iterating through items.items, except for items.items[0]

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi