[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1489
  • Last Modified:

Lightswitch HTML Client - How do you pass a value from one screen to another?

My question in particular is based upon a view screen, where I have a unique ID and I want to pass this to an Add/Edit screen. So rather than the user having to type this out every time, they can simply just click on the details picker plus symbol and selected the value(s) associated with that.

So for example I have a CustomerID which is 1, and they have made an order (OrderID 100). On this Order I want to add an item they have purchased and display it onto the OrdersViewScreen. Within Lightswitch I have an AddDeliveryLine button which takes me to this particular Add screen. I have set up a query based on the CustomerTable, which asks the user to search by their CustomerID… When I type in 1 myself it will load up the items the customer is awaiting within the CustomerOrders details picker.

Logic
 

The values need passing within JavaScript however the following methods ive tried have not worked:

1.
myapp.AddEditDeliveryLine.CustomerID_postRender = function (element, contentItem) {

    contentItem.screen.CustomerID =
    contentItem.screen.DeliveryLine.DeliveryNotes.CustomerTable.CustomerID;
};

2.
myapp.ViewDeliveryNote.ShowAddEditDeliveryLine_canExecute = function (screen) {
    return screen.CustomerID;
};
myapp.ViewDeliveryNote.ShowAddEditDeliveryLine _execute = function (screen) {
    return myapp.showAddEditDeliveryLine(screen.CustomerID);
};

I’ve added a print screen of what I am trying to accomplish. Thanks for any help.
What-Im-aiming-for.jpg
0
wint100
Asked:
wint100
1 Solution
 
David Johnson, CD, MVPOwnerCommented:
Many different ways one of the best ways is by using the example shown @ http://stackoverflow.com/questions/15269515/lightswitch-passing-data-from-one-screen-to-another

In your List Detail, you need to create a Data Item to store the User Name. In the Properties for that Data Item, you then need to check "Is Parameter".
When you call your second screen from the code in your SearchUserInformationLists screen, you pass the value of that Data Item to it.

this.Application.ShowZeiterfassungsListDetail(this.MyUserName);

The screen Parameters should be the first items in your list of Data Items on the left of the Screen Designer. You can pass more than one parameter and the order that you pass them in is the order in which they are listed in your Data Item list.

this.Application.ShowZeiterfassungsListDetail(this.Param1, this.Param2, this.Param3);
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now