title: How to pass var variable to custom control
body: <p>I want to create a generic action bar custom control with Save, Edit, Delete, ... buttons.</p>
  
  <p>How can I pass var variable from xpage to a custom control?</p>
  
  <p>Update</p>
  
  <p>I successfully transferred document object to custom control and I can Save the changes made in document, but I can't delete it with same object.
  Update:</p>
  
  <pre><code>&lt;xp:this.action&gt;
      &lt;xp:executeScript
          script="#{javascript:compositeData.datasrc.save()}"&gt;
      &lt;/xp:executeScript&gt;
  &lt;/xp:this.action&gt;
  </code></pre>
  
  <p>Delete is not working:</p>
  
  <pre><code>&lt;xp:deleteDocument
      message="Do you want to delete?"
      var="#{javascript:compositeData.datasrc}"&gt;
      &lt;xp:this.name&gt;&lt;![CDATA[#{javascript:var page = sessionScope.get("prevview");
      return (page=='')?'home.xsp':page}]]&gt;    &lt;/xp:this.name&gt;
  &lt;/xp:deleteDocument&gt;
  </code></pre>
  
  <p>I tried also with:</p>
  
  <pre><code>var="#{javascript:compositeData.datasrc.getDocument()}"&gt;
  </code></pre>
  
  <p>but also didn't work.</p>