locked
Two way binding + converter HTML RRS feed

  • Question

  • Hi,

    I am trying to create a two way binding with a converter function but I cannot manage myself.

    This is what I'm trying:

    <input type="number" id="linePrice" data-win-bind="value: Price InvoiceDetailConverter.FormatPrice Binding.Mode.TwoWay" />

    But I get an error.

    Any advice on this??

    thanks

    Friday, November 29, 2013 9:38 AM

Answers

  • Hi etait,

    What is the error message? I guess it should be a syntax error if your post code is what you wrote in you app.

    You need some semicolons inside your data-win-bind btween value and BindingMode, this sample may help you with a better understanding with WinJS binding: http://code.msdn.microsoft.com/windowsapps/DeclarativeBinding-bfcb42a5#content

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by etait Monday, December 2, 2013 9:04 AM
    Friday, November 29, 2013 4:14 PM
    Moderator

All replies

  • Hi etait,

    What is the error message? I guess it should be a syntax error if your post code is what you wrote in you app.

    You need some semicolons inside your data-win-bind btween value and BindingMode, this sample may help you with a better understanding with WinJS binding: http://code.msdn.microsoft.com/windowsapps/DeclarativeBinding-bfcb42a5#content

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by etait Monday, December 2, 2013 9:04 AM
    Friday, November 29, 2013 4:14 PM
    Moderator
  • Thank you!!

    I`ve been working on it and I've managednot to use a converter. I need it all in the HTML, but I have not figured out which is the property that sets the Binding mode.

    It is working now but without the converter, just like this:

    <input type="number" id="linePrice" data-win-bind="value: Price Binding.Mode.TwoWay" />

    Monday, December 2, 2013 9:03 AM