locked
How to use a selected List value in a other screen as a Parameter RRS feed

  • Question

  • Hello,

    How do I set-up a JS Method to use a selected value in a Brows screen "A" and use this value in a other Brows screen "B" in a Parameter/Field to filter the List and output?

    I tried with the following basic code with additions...

    http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/1196/Visual-Studio-LightSwitch-Screen-Navigation-and-Advanced-JavaScript-Examples.aspx

    myapp.AddEditProduct.Copy_execute = function (screen) {
    
        myapp.showAddEditProduct(null, {
    
            beforeShown: function (addNewScreen) {
    
                var copied_item = screen.Product;
    
                var new_item = new myapp.Product();
    
    
    
    
    
                new_item.Parameter = copied_item.SelVal;
    
    
    
                // Set Product
    
                addNewScreen.Product = new_item;
    
            }
    
        });
    
    };

    many thanks for your help

    marcel

    Friday, June 17, 2016 1:31 PM

Answers

  • Hi marcel,

    According to your description, you want to pass parameters from one screen to another screen and use them in the passed to screen.

    Please define these parameters on the first screen where the parameters pass from. Then please add data items one the second screen where the parameters pass to.  And set this data items you added in second screen as parameter. Now you can edit the link for these data items.

    Then detailed steps, please refer to following links, which introduce how to pass the parameters. Hope that can help you.

    http://stackoverflow.com/questions/25638088/lightswitch-passing-paramaters-in-the-html-client

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/9d65b24e-f3ee-4f9f-a09d-6f7e8330b3b7/html-client-pass-local-properties-values-between-screens?forum=lightswitch

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, June 20, 2016 1:37 AM
    Moderator
  • Hi marcel,

    Thanks for your response and I'm glad that the original posted problem have been resolved. Please mark the helpful reply as answer which is benefit to other communities who has the same problem.

    >> one additional question, how do i have to set up the js if the screen should not go to a other screen, instead to a other register within the same screen, e.g.

    Could you please explain the mean of "to a other register within the same screen" detailed in a new thread? Since we often ask one question in one thread in our forum, I suggest you create a new thread and describe your issue detailed, which can let other communities join into to provide more suggestion.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by marcel_W Tuesday, June 21, 2016 1:49 PM
    Tuesday, June 21, 2016 2:43 AM
    Moderator

All replies

  • Hi marcel,

    According to your description, you want to pass parameters from one screen to another screen and use them in the passed to screen.

    Please define these parameters on the first screen where the parameters pass from. Then please add data items one the second screen where the parameters pass to.  And set this data items you added in second screen as parameter. Now you can edit the link for these data items.

    Then detailed steps, please refer to following links, which introduce how to pass the parameters. Hope that can help you.

    http://stackoverflow.com/questions/25638088/lightswitch-passing-paramaters-in-the-html-client

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/9d65b24e-f3ee-4f9f-a09d-6f7e8330b3b7/html-client-pass-local-properties-values-between-screens?forum=lightswitch

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, June 20, 2016 1:37 AM
    Moderator
  • hi weiwei

    many thanks for your help, the second link was helpful and it works.

    one additional question, how do i have to set up the js if the screen should not go to a other screen, instead to a other register within the same screen, e.g.

    myapp.showScreenName.[?REGISTERNAME?]???

    do you know how to ...

    best regards

    marcel

    Monday, June 20, 2016 1:18 PM
  • Hi marcel,

    Thanks for your response and I'm glad that the original posted problem have been resolved. Please mark the helpful reply as answer which is benefit to other communities who has the same problem.

    >> one additional question, how do i have to set up the js if the screen should not go to a other screen, instead to a other register within the same screen, e.g.

    Could you please explain the mean of "to a other register within the same screen" detailed in a new thread? Since we often ask one question in one thread in our forum, I suggest you create a new thread and describe your issue detailed, which can let other communities join into to provide more suggestion.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by marcel_W Tuesday, June 21, 2016 1:49 PM
    Tuesday, June 21, 2016 2:43 AM
    Moderator