title: Passing a row data var from View Panel as property to a Custom Control
body: <p>I have a <code>&lt;xp:viewColumn&gt;</code> in a Custom Control used for document locking purposes; I need to pass the row data var from my View Panel as Custom Property to my Custom Control.</p>
  <p>I defined a new Property on Custom Control as:</p>
  <blockquote>
  <p>Name: rowEntry</p>
  <p>Type: com.ibm.xsp.model.ViewRowData</p>
  </blockquote>
  <p>This is an example of my <code>ccColDocLocking</code> inside my View Panel; it works fine if I use same var on all my View Panels, but, I don't want to hard code it.</p>
  <pre><code>    &lt;xp:viewPanel rows=&quot;15&quot; id=&quot;viewPanel1&quot; viewStyle=&quot;width:100%&quot;
              rowClasses=&quot;even,odd&quot; var=&quot;rowData&quot;&gt;        
         &lt;xp:this.data&gt;
              &lt;xp:dominoView viewName=&quot;IntakeForms&quot; var=&quot;view1&quot;&gt;&lt;/xp:dominoView&gt;
         &lt;/xp:this.data&gt;
         &lt;xc:ccColDocLocking rowEntry=&quot;#{javascript:rowData}&quot;&gt;&lt;/xc:ccColDocLocking&gt;
         &lt;xp:viewColumn columnName=&quot;reqDate&quot; id=&quot;viewColumn1&quot;
              displayAs=&quot;link&quot; openDocAsReadonly=&quot;true&quot;&gt;
              &lt;xp:this.converter&gt;
                  &lt;xp:convertDateTime pattern=&quot;MM/dd/yyyy&quot;&gt;&lt;/xp:convertDateTime&gt;
              &lt;/xp:this.converter&gt;
              &lt;xp:viewColumnHeader value=&quot;Request  Date&quot;
                  id=&quot;viewColumnHeader1&quot; sortable=&quot;true&quot;&gt;
           &lt;/xp:viewColumnHeader&gt;
          &lt;/xp:viewColumn&gt;
   &lt;/xp:view&gt;
  </code></pre>
  <p>This is from my Custom Control:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;xp:view xmlns:xp=&quot;http://www.ibm.com/xsp/core&quot;&gt;    
      &lt;xp:viewColumn id=&quot;viewColDocLock&quot;&gt;
          &lt;xp:this.facets&gt;
              &lt;xp:viewColumnHeader xp:key=&quot;header&quot; id=&quot;viewColumnHeader5&quot;&gt;
              &lt;/xp:viewColumnHeader&gt;
          &lt;/xp:this.facets&gt;
          &lt;xp:this.value&gt;&lt;![CDATA[#{javascript:&quot;&quot;}]]&gt;&lt;/xp:this.value&gt;
          &lt;xp:image id=&quot;imgDocLock&quot;&gt;
              &lt;xp:this.url&gt;&lt;![CDATA[#{javascript:if (rowData.getDocument().hasItem(&quot;$Writers&quot;) != &quot;&quot;) {
      return &quot;/locked.gif&quot;;
  }}]]&gt;&lt;/xp:this.url&gt;
              &lt;xp:this.alt&gt;&lt;![CDATA[#{javascript:&quot;Document locked by &quot; + @Name('[Abbreviate]', rowData.getDocument().getItemValueString(&quot;$Writers&quot;))}]]&gt;&lt;/xp:this.alt&gt;
              &lt;xp:this.title&gt;&lt;![CDATA[#{javascript:&quot;Document locked by &quot; + @Name('[Abbreviate]', rowData.getDocument().getItemValueString(&quot;$Writers&quot;))}]]&gt;&lt;/xp:this.title&gt;
          &lt;/xp:image&gt;
      &lt;/xp:viewColumn&gt;
  &lt;/xp:view&gt;
  </code></pre>
  <p>Error I'm getting is: [ReferenceError] 'compositeData' not found</p>
  <p>when I try to replace <code>rowData.getDocument()</code> by <code>compositeData.rowEntry.getDocument()</code></p>