This is a migrated thread and some comments may be shown as answers.

Binding Kendo WIndow and Input with type Password

2 Answers 132 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 06 Aug 2012, 09:50 PM
I am trying to implement a MVVM pattern for my website's login function.

The site returns with status code 401 when authentication fails.  The goal would be to:
  1. Update my view model to indicate that the user is not authenticated.  Example: viewModel.set("authenticated", false)
  2. When authenticated is false, display a Kendo window with the username/password prompt
  3. Then the user presses submit within this window, fire my login method
Everything works except I am having the following problems:
  1. I can't find a way to bind the open/close state of the Kendo window (my login window) to the authenticated property of my viewModel
  2. When I bind to the input of type password, it seems to be one-way.  I am able to get the password the user typed in and pass this up to my web method, but during the login function I clear the password viewModel.set("password", "") but the input control does not update.  If I change it to a regular input with type text it seems to work.

2 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 09 Aug 2012, 04:00 PM
Hello Jeffrey,

The open/close state of the Kendo window cannot be toggled through MVVM binding. To achieve that I would recommend to define a function in the view model that uses the open and close methods of the widget.

Regarding your second second question - I tested a similar scenario and tried to reproduce the behaviour but to no avail. Could you please check my test page and let me know what I am missing?

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jeff
Top achievements
Rank 1
answered on 10 Aug 2012, 09:05 PM
Thanks Alexandar.  I looked at your Fiddle and then tried it again myself.  The password binding is working now.  I'm not sure why it wasn't updating before but perhaps it had to do with my failed attempts at binding the window open/close via MVVM, which I have since abandoned.
Tags
MVVM
Asked by
Jeff
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or