• Displaying All Locks

    By Dwain A Wuerfel 1 decade ago

    I have been trying to use a repeat control to display all the locks that are enabled within my application without any luck.  I found this post, http://www.qtzar.com/dslh-7s7juy/, by Declan which does show all the applicationScopes as it is supposed to.  However, it is also showing any other managed beans you have designated as application scopes.  When I try to change the repeat and computed fields to use the name of my managed bean it gives an error evaluating expression.

    So, hoping you can provide some guidance on how to display the locks within the HashMap created within your managed bean?

    Thanks,

    Dwain

    • You could do like this

      By Fredrik Norling 1 decade ago

      Hi Dwain,

      Thanks for trying out my openntf struff.

      This is a way to get all the locks into a repeat control. place this code inside a repeat control

      <strong><em>var map:java.util.HashMap=DocLock.getMap()</em></strong></div>
      
      <strong><em>var i=map.entrySet().iterator()</em></strong></div>
      
      <strong><em>var data=[]</em></strong></div>
      
      <strong><em>while(i.hasNext()) {</em></strong></div>
      
      <strong><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var &nbsp;entry = i.next();</em></strong></div>
      
      <strong><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;data.push(entry.getKey()+&quot;:&quot;+entry.getValue())</em></strong></div>
      
      <strong><em>&nbsp; &nbsp; &nbsp; }</em></strong></div>
      
      <strong><em>return data</em></strong></div>
      

       

      The data js Array will contain Key + semikolon + value (UserName)

      • List all Locks in Managed Bean

        By Dwain A Wuerfel 1 decade ago

        This worked perfectly.  I am going to create a SO question and put this as the answer for any others looking to do the same