title: Using Openlog from ssjs. what should 'this' be?
body: <p>I am reading from the documentation on openlog:</p>
  
  <blockquote>
    <p>Because Server-Side JavaScript Script Libraries have no context for
    which component called them, you will not be able to use this to pass
    the component to OpenLog. Instead, if you wish to identify which
    component called the code, you need to pass the component into your
    SSJS function as a parameter.</p>
  </blockquote>
  
  <p><a href="https://wiki.openntf.org/display/XOL/Using+from+SSJS+Script+Libraries" rel="nofollow noreferrer">https://wiki.openntf.org/display/XOL/Using+from+SSJS+Script+Libraries</a></p>
  
  <p>So I have a link which calls a SSJS function that resides in a script library:</p>
  
  <pre><code>&lt;xp:link escape="true" text="#{obj.name}" rendered="#{obj.internal eq '3'}"&gt;
          &lt;xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="dlgAssessment"&gt; &lt;xp:this.action&gt;&lt;![CDATA[#{javascript:openDialogAssessment(this);}]]&gt;&lt;/xp:this.action&gt; &lt;/xp:eventHandler&gt; &lt;/xp:link&gt;
  </code></pre>
  
  <p>The function registers failures to openlog as followed:</p>
  
  <pre><code>function openDialogAssessment(component){
      try {       
          try{
             assessmentBean.removeAssessment("assessment");
          }catch(e){
              openLogBean.addError(e,component);
          }
  //... more code
  }
  </code></pre>
  
  <p>If I look at the log result in openlog I read:</p>
  
  <blockquote>
    <p>null - Developer has passed 'this' directly from an SSJS function in
    Script Library /proposal.jss. Please note, SSJS Script Libraries have
    no context for components. You must pass the relevant component into
    your SSJS function as a parameter.</p>
  </blockquote>
  
  <p>Can someone tell me what I am doing wrong and how I could pass the component to the function correctly?</p>