none
Selected Item controls doesn't refresh/update when used in modal window with 2013 Preview

    Question

  • Hi All,

    I am using ModalWindow class, as per Yann blog, it works in LS 2012 but there is a small UI issue with 2013 Preview, I guess it's not an issue with ModalWindow class. When model window open, while adding a new entity, selected item control values do not refresh. Controls updates/refreshes with default value only on control focus, otherwise user will see previously created record values.

    Thanks,
    Suneel

    Tuesday, August 06, 2013 6:31 PM

Answers

  • Hi Suneel,

    We've confirmed the problem in RC and have logged a bug. Can you try this workaround?

    In the AddEntity() method, add the following line: 

    PublicSubAddEntity()

    _isEditing = False

    _screen.OpenModalWindow(_dialogName)

    _collection.AddNew()

    _screen.FindControl(_dialogName).DisplayName = "Add "+

    _collection.Details.GetModel.ElementType.Name

    BaseOpenDialog()

    EndSub


    Senior Program Manager, Visual Studio Community http://www.bethmassi.com http://msdn.com/lightswitch http://dev.office.com

    • Marked as answer by SuneelK Thursday, September 12, 2013 8:45 PM
    Thursday, September 12, 2013 12:43 AM

All replies

  • Hi, 

    I'm interesting in this UI issue. I also want to create a custom Add and Edit Modal Window. I try to use this ModalWindow class. However I get a Add Modal Window without button, textblock, textbox. There are nothing in the Window. Would you like to show me how do you use this class? Thank you!

    Yao

    Thursday, August 08, 2013 8:53 AM
  • Hi Suneel,

    Do you make sure the project works well in LS2012 and you create the same project in Visual studio 2013Preview?  Yann has posted the blog in MSDN too .

    If you encounter the problem with “Enter” key, we can stop the key event at the control level(http://social.msdn.microsoft.com/Forums/vstudio/en-US/174264d3-f094-46e5-b5a7-6a606916070d/modal-window-enter-key-bug-fix ).

    Hope it helps.

    Please provide us more detail, it will be very helpful to troubleshoot.


    Yunjie Pei
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, August 08, 2013 10:19 AM
  • Hi Yunjie Pei,

    As
    per your suggestion, I have created a test project in LS2012 with ModalWindow helper class. Haven't notice any UI glitches. Converted the same to LS2013 Preview, yes I can reproduce the above issue.

    Here is the screen shot of model window when user clicks on "Create New Employee". If focus moves to last name or notes then only value in control refreshes. Hope this helps, let me know if you need any more specific details.

    Thanks for your time,
    Suneel

    Thursday, August 08, 2013 4:35 PM
  • Hi Yao,

    As
    per your message I guess you have no issue with initializing and activating the model window helper class. Please make sure the controls are added in model window group. Please verify the screen design. Here by I am attaching mine for your reference. As a side note verify the control "Is Visible" property and make sure it's checked. Only Model Window "Is Visible" property should be unchecked.

    Hope this helps.

    Thanks,
    Suneel

    Thursday, August 08, 2013 4:45 PM
  • Hi Suneel,

    Thanks.

    It works in Visual Studio 2012 in my machine. However, I don't understand why this project cannot work successfully in VS2013. I will try it.

    Yao

    Friday, August 09, 2013 1:13 AM
  • Hi Suneel,

    I have converted the project into Visual Studio 2013. However, I think it works well in my machine.

    I show you:

    Any thing different? Would you like to show me more information in detail?

    Yao

    Friday, August 09, 2013 8:09 AM
  • Hi Yao,

    Good to know you are able to convert the project without any issues. Here is the scenario to replicate my issue.

    1. Click on add a new record button
    2. Enter name, phone, email etc…
    3. Click on OK button
    4. Click on add a new record button again
    5. At this point text box controls in the model window should be blank.

    But in LS 2013 Preview, controls still have values from previously added record. Once user moves focus to other controls then only value refreshed, in that control.
    Thanks,
    Suneel


    • Edited by SuneelK Friday, August 09, 2013 3:19 PM
    Friday, August 09, 2013 3:19 PM
  • Hi Suneel,

    I think I have reproduced your problem:

    Although the textbox display previous record, the new value we entered will not be affected. If we do not enter the new value where it displays the previous value, it does not display the previous record when we click “ok”. I assume that it has default value in visual studio 2013 preview.


    Yunjie Pei
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, August 13, 2013 12:47 PM
  • Hi Yunjie Pei,
    Is there a way to override this default behavior? Basically it confuses the user, user clicks on OK (assuming those are default values) and a new record with empty/nulls are added to the grid.

    Thanks,
    Suneel

    Tuesday, August 13, 2013 4:33 PM
  • Issue still exists in 2013 RC too.

    Thanks,
    Suneel

    Tuesday, September 10, 2013 2:41 AM
  • Hi Suneel,

    Not sure what would have changed in the Silverlight client to cause this but we're looking into it. Thanks for reporting this!

    Cheers,

    -Beth


    Senior Program Manager, Visual Studio Community http://www.bethmassi.com http://msdn.com/lightswitch http://dev.office.com

    Tuesday, September 10, 2013 11:58 PM
  • Hi Suneel,

    We've confirmed the problem in RC and have logged a bug. Can you try this workaround?

    In the AddEntity() method, add the following line: 

    PublicSubAddEntity()

    _isEditing = False

    _screen.OpenModalWindow(_dialogName)

    _collection.AddNew()

    _screen.FindControl(_dialogName).DisplayName = "Add "+

    _collection.Details.GetModel.ElementType.Name

    BaseOpenDialog()

    EndSub


    Senior Program Manager, Visual Studio Community http://www.bethmassi.com http://msdn.com/lightswitch http://dev.office.com

    • Marked as answer by SuneelK Thursday, September 12, 2013 8:45 PM
    Thursday, September 12, 2013 12:43 AM
  • Thanks Beth, it is working. User still sees old record data and then immediately, all controls in model window, refreshes with no value (or default value). Better than retaining old record data. I am getting another issue with ManyToManyControls Extension. I have logged another ticket here.
    -Suneel
    Thursday, September 12, 2013 8:55 PM
  • I have the same problem as you, but i dont know how to fix it, my project is in C#
    Wednesday, October 02, 2013 5:15 PM