locked
Declarative Binding in metro navigation app RRS feed

  • Question

  • edit: unable to upload images so will explain

    I have a weird issue with the navigation app. the problem is simple though but i am unable to debug it. Here's a list of steps that i did to arrive at the problem

    1. create a navigation app (it creates 2 html files, default.html and home.html)
    2. create a sampledata.js file and link it to home.html
    3. create sample json content in sampledata.js
    4. write the bindable template code in home.html
    5. lets assume the template is <div data-win-bind="{innerText:name}"></div>
    6. define the list view 
    7. call winjs.ui.processall in home.js, under the ready: function()
    8. wait for output

    if the entry point of the application i set as default.html then i get the following output:

    the data gets bounded in the right place but is displayed as a stringified version of the JSON content. if i wanted to bind a name, it would be displayed as <div>{name:warlord}</div>

    otherwise if the entry point is directly home.html then i get the expected result

    the output comes correctly in the data is in the right place and only the value is shown in the (key, value) pair of JSON. eg, if name was bound then the output comes as <div>warlord</div>

    so any ideas why the binding is failing initially?


    • Edited by WrathOfZombies Sunday, July 1, 2012 12:10 PM Image uploads not working
    Sunday, July 1, 2012 12:01 PM

Answers

  • Hi W,

    Can you post a simple sample program showing the problem?  It sounds like your template is not bound.

    You can post things free using SkyDrive and then make it a public folder and post the link back here.

    -Jeff


    Jeff Sanders (MSFT)

    Monday, July 2, 2012 2:33 PM
    Moderator

All replies

  • Hi W,

    Can you post a simple sample program showing the problem?  It sounds like your template is not bound.

    You can post things free using SkyDrive and then make it a public folder and post the link back here.

    -Jeff


    Jeff Sanders (MSFT)

    Monday, July 2, 2012 2:33 PM
    Moderator
  • Thanks a lot bud. that was the thing. Silly me. I just changed the template and this time around used blend to assign it for me. Seems that we need to use select(<template id>) to get it to work in declarative binding. :D


    warlord1609

    Friday, July 6, 2012 7:21 AM