Search code examples
javascriptvisual-studio-lightswitchlightswitch-2013

Lightswitch - Passing Paramaters in the HTML Client


ive been trying for ages now to pass the value with little success, the image below is what I am aiming for:

The Parameter I want to pass

and this is the table structure/relationships enter image description here

cheers for any help you can give me guys, this is beginning to be a real pain in the arse


Solution

  • based on this I managed to solve my issue by doing the following

    LightSwitch: Passing data from one screen to another -> for Desktop Client

    For HTML Client

    1. You MUST have a parameter on the screen from which you are passing the data, this is done by creating a data item, i.e. int in the below example, and in the post render code for this use the following code:
    myapp.ViewDeliveryNote.DeliveryIDPass_postRender = function (element, contentItem) {
    
        contentItem.screen.DeliveryIDPass = //created parameter
        contentItem.screen.DeliveryNote.DeliveryID; //the unique ID from the screen
    
    };
    
    1. On the screen you want to pass to, add a new data item as that datatype OR if you are using it as a search parameter, use this.

    2. Find the parameter/data item you added on the left hand panel and click on the item, now in the properties window tick (is parameter)

    3. If there was a previous link between the pages via a button, remove the on tap and re-add it... you will now see an additional box where the application is asking for the value to pass, select the one you want and that shoud work :)

    hope this helps