locked
wincontrol is not set RRS feed

  • Question

  • Hello everybody,

    I'm defining a control in default.html like so:

    <divid="myRatingControl"data-win-control="WinJS.UI.Rating"data-win-options="{maxRating: 10}" />

    Unfortunately, I'm not able to access the wincontrol propetry in default.js

    WinJS.UI.processAll().done(function () {
                    var control = document.getElementById("myRatingControl").wincontrol;
                 });

    It does not seem to be set at all as code completion offers no according expand option. However, when I'm defining it in default.js itself, wincontrol property is set.

    Any ideas what I'm doing wrong? Thanks! --Oliver.
    Tuesday, March 20, 2012 9:28 AM

Answers

All replies

  • There is a typo in the html tag. Of course, it is declared as

    <div id="myRatingControl"data-win-control="WinJS.UI.Rating"data-win-options="{maxRating: 10}" />
    • Marked as answer by oarafat Tuesday, March 20, 2012 10:03 AM
    • Unmarked as answer by oarafat Tuesday, March 20, 2012 10:03 AM
    Tuesday, March 20, 2012 9:29 AM
  • Solved it. Div tags are required to have an explicit closing tag, i.e. <div></div>

    EDIT:

    Unfortunately, that was just worked by accident. I still get the same Problem with other examples that are also using
    WinJS.UI.Rating

    Any ideas? What am I missing?

    • Marked as answer by oarafat Tuesday, March 20, 2012 10:04 AM
    • Unmarked as answer by oarafat Tuesday, March 20, 2012 1:29 PM
    • Edited by oarafat Tuesday, March 20, 2012 1:31 PM
    Tuesday, March 20, 2012 10:04 AM
  • Hi,

    I think this property should be winControl instead of wincontrol. What happens if you try winControl?


    Allen Chen [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, March 21, 2012 8:09 AM