Setting session variables with Client Side Framework API

To create a session variable, a CSF function is provided.

gwc.dialog.setVariable(varName, varValue)
In the template itself, you would add this function using a line such as the following:
<input type="button" onclick=" gwc.dialog.setVariable('var1','value1')" />

When you use this function, the CSF submits the variable to the GAS. The session variable is immediately created in the application context.

Note: Setting a variable to an empty string is equivalent to deleting the variable.