locked
How to pass a value from the screen to another screen in Lightswitch HTML Client RRS feed

  • Question

  • Hi,

    I'm having a hard time figuring out how to pass value of the current screen to another screen in Lightswitch HTML client.

    What I'm trying to do is, on the current screen there's a list of Employee under the same Job. 

    If a user want to add Employee, a user click a button and should show only all Employees not related to the current Job (this will be based on a query with filter like job<>currentJob), however, I'm not sure how to pass the current Job value to the  query.

    After showing the list of available employee, user tap the employee and update the Job value with the current Job, again, how to pass the value of current Job to this screen?

    Please can someone show me how to accomplish this. Many thanks

    John

    Friday, July 26, 2013 5:15 PM

All replies

  • I finally make it work based on Beth Massi Video guide http://msdn.microsoft.com/en-us/vstudio/ff961919 in passing the data to another screen.

    However, I'm encountering problem in updating the employee, here's the code to update employee based on the value pass to JobSelected. I can't seem to make it work, the Employee and Job has one-to-many relationship.

    myapp.AddEmployeeToJob.Employee_ItemTap_execute = function (screen) {
        // Write code here.
        var emp = screen.AddEmp.selectedItem;
    
        emp.setJob(screen.JobSelected);
    
    };
    setting up the value to emp.Job.Id = screen.JobSelected also not working. I'm not sure what I'm really missing, any advise is really appreciated.

    Many thanks


    • Edited by Janx2av Friday, July 26, 2013 6:57 PM update
    Friday, July 26, 2013 6:41 PM