how to save the selection in a list

LabKey Support Forum (Inactive)
how to save the selection in a list Jon (LabKey DevOps)  2015-04-28 12:43
Status: Closed
 
Hi Feifei,

In order to pass selected data from your one query web part from one wiki page over to another wiki page, you would have to:

1. Setup a custom button either in Javascript or in the XML Metadata and use the onClick option to trigger the Javascript.

https://www.labkey.org/wiki/home/Documentation/page.view?name=customButtonBars
https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.QueryWebPart.html#constructor

2. Your onClick would have to specifically identify just the rows that were checked on (probably using something like .checked on those checkbox objects - http://www.javascriptkit.com/jsref/checkbox.shtml)

3. Once the boxes that are checked on are identified, the rowIDs and/or the values for all of those identified rows would need to be put in an array and then passed into a Labkey ActionURL (a buildURL in this case - https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.ActionURL.html#.buildURL) to construct the path to the other wiki page and add the array to a parameter to be used by the other wiki page and then the user would be redirected via window.location)

4. Your other wiki page would then have to take the values that were passed into the URL as an array and then either use the values from that URL via another Labkey ActionURL (probably getParameters or getParameterArray - https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.ActionURL.html#.getParameterArray) and use those parameters within your query web part Javascript API code or use it as a apart of a selectRows Javascript API call.

Regards,

Jon