title: xpages - how to set a scope variable from client side javascript?
body: <p>I'm trying to set an XPages scope variable from Client side JavaScript. I have an XPage which contains several sections which are shown or hidden using Dojo. On this XPage I have a button which executes some server side JavaScript. Once the SSJS behind the button executes, the section of the XPage which is visible by default is again visible, rather than the section which was visible immediately prior to the button being clicked. I would like the section which was visible prior to the button being clicked to also be visible after the SSJS behind the button has executed. </p>
  
  <p>To do this I have thought of using a scope variable - use client side JavaScript to calculate which section of the XPage which is currently visible, set this value in a scope variable and read the scope variable in the <code>onClientLoad</code> event of the XPage to again make this section visible (and hide all other sections). 
  However, I have found no way of setting a scope variable from client side JavaScript. I have tried adding </p>
  
  <pre><code>var xyz = "#{javascript:viewScope.put('sectionDisplay','Section')}"
  </code></pre>
  
  <p>to the <code>onClick</code> client event of the button but this sets the scope variable regardless of whether the button is clicked or not.  </p>
  
  <p>Before XPages, I would have used the querystring to pass variable from one page to another. How can I now do this?</p>