SSJS in client side works while same code in server side of button does not work

Trying to use getColumnValue in an xpages data table:

In the course of troubleshooting, I added the code that was failing on the server side to the client side event of the button:

Client Side (this one works):

contract=‘#{javascript:var selected = rowdoc.getColumnValue(“contracts”);return(selected)}’;

Server Side (this one does not work, says that rowdoc is null):

var selected = rowdoc.getColumnValue(“contracts”);

print ("selected contract: " + selected);

I’m also using the rowdoc.getColumnValue(“contracts”) in other columns of the data table to build links, etc, and all of those are working.

Subject: Not sure you use print

I am not sure if that is your issue, but, instead of print use return?

Or just have "selected contract: " + selected as your last line so it returns that value.

Howard