I have a view panel control that displays a list of documents and some information about each. One of the columns is the storage location of the item recorded in the document. I want to make that column a clickable link so when the user clicks it, they go to a different XPage that shows all the documents with that storage location. An example:
ID Location
12345678 ABCD
98765432 WXYZ
11223344 ABCD
Clicking the ID would open that document, but clicking ABCD would go to an XPage that would display all documents with a Location of ABCD.
This is what I have for the column value:
<xp:this.value><![CDATA[#{javascript:return "<script>sessionScope.set(\"trayId\",\"+rowData.getColumnValue('StorageLocationID')+\");</script><a href=\"./location.xsp\">"+rowData.getColumnValue('StorageLocationID')+"</a>";}]]></xp:this.value>
It displays the value properly and goes to the right XPage but I can't figure out how to set the sessionScope variable that I can use to filter the data source on location.xsp to show just the one location. I think I have to create HTML in the column because it threw an error when I set 'Show values in the column as links' and used onclick events to set a sessionScope variable for the location name and then open the location.xsp.
I could probably do this in a repeat control, but it seems like there should be a way to make this work in a view panel, since I feel like I am really close.