title: How to do a partial refresh of multiple items in Xpages correctly
body: <p>I have read many of the blog posts on doing a partial refresh on more than one element, but I cannot seem to get it to work.</p>
  
  <p>I made a "toy" example, an Xpage with two fields and one button. Both fields are bound to a sessionScope counter. The button increments the counter and does a partial refresh on the containing panel.</p>
  
  <p>I want to do a partial refresh on the first field, which is not in the panel [in my real Xpage the two fields are very far apart on the form.</p>
  
  <p>Tried many different things to get this to work, but none worked. Is it even possible to do this?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xp:view xmlns:xp="http://www.ibm.com/xsp/core"
      xmlns:xe="http://www.ibm.com/xsp/coreex"
      xmlns:xc="http://www.ibm.com/xsp/custom"
      style="background-position:center left"
      xmlns:on="http://www.openntf.org/domino/xsp" viewState="nostate"
      xmlns:debug="http://www.openntf.org/xsp/debugtoolbar"&gt;
  
      First Var&lt;br&gt;&lt;/br&gt;
  
      &lt;xp:text escape="true" id="computedField1" value="#{sessionScope.number}"&gt;
      &lt;/xp:text&gt;
  
          &lt;br&gt;&lt;/br&gt;
          &lt;xp:br&gt;&lt;/xp:br&gt;
          &lt;br&gt;&lt;/br&gt;
  
      Second Var&lt;xp:panel id="pnl1"&gt;
          &lt;xp:text escape="true" id="computedField2" value="#{sessionScope.number}"&gt;
          &lt;/xp:text&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;br&gt;&lt;/br&gt;
          &lt;xp:button value="Label" id="button1"&gt;
              &lt;xp:eventHandler event="onclick" submit="true"
                  refreshMode="partial" refreshId="pnl1" execMode="partial"
                  execId="pnl1"&gt;
                  &lt;xp:this.action&gt;&lt;![CDATA[#{javascript:var t = sessionScope.number + 1;
  sessionScope.number = t;}]]&gt;&lt;/xp:this.action&gt;
              &lt;/xp:eventHandler&gt;
          &lt;/xp:button&gt;
      &lt;/xp:panel&gt;
  
  &lt;/xp:view&gt;
  </code></pre>
  
  <p>Read Knut's link and got this to work. I made a change to the event handler of the button and it worked. Here is the code:</p>
  
  <pre><code>            &lt;xp:eventHandler event="onclick" submit="true"
                  refreshMode="partial" refreshId="pnl1" execMode="partial"
                  execId="pnl1"&gt;
                  &lt;xp:this.action&gt;&lt;![CDATA[#{javascript:var t = sessionScope.number + 1;
  sessionScope.number = t;}]]&gt;&lt;/xp:this.action&gt;
                  &lt;xp:this.onComplete&gt;&lt;![CDATA[XSP.partialRefreshPost("#{id:computedField1}");]]&gt;&lt;/xp:this.onComplete&gt;
              &lt;/xp:eventHandler&gt;
  </code></pre>