Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The computation of the repeat elements isn't very efficient - the JSF lifecycle will make you lookup the values twice. You could try this instead:</p> <pre><code>// If we looked them up before we don't need to do anything if (viewScope.approveIDs) { return viewScope.approveIDs; } // Look up the employee details view to get the employee appraisal details from the current database var curDB:NotesDatabase = session.getCurrentDatabase(); var vwlkApprView:NotesView = curDB.getView("vwlkAllApprApper"); var collDocAppr:NotesViewEntryCollection = vwlkApprView.getAllEntriesByKey(sessionScope.EmployeeID); // Don't do a count, slow! var result = new java.util.Vector(); // Add all unids var ve:NotesViewEntry = collDocAppr.getFirstEntry(); while (ve != null) { var nextVe = ve.getNextEntry(ve); result.add(ve.getUniversalId()); // eventually check to avoid categories? ve.recyle(); ve = nextVe; } viewScope.approveIDs = result.isEmpty() ? null : result; collDocAppr.recyle(); vwlkApprView.recycle(); return viewScope.approveIDs; </code></pre> <p>This code (off my memory, so check syntax) has a few notable properties:</p> <ul> <li>Error handling is missing, so please add <code>try { } catch(e ) { }</code> generously</li> <li>.recyle() is used to release memory</li> <li>ViewEntryCollection instead of DocumentCollection -> better performance</li> <li>UNIDs are cached in a Vector, so this needs to run only once</li> <li>the variable apprDoc now directly contains the unid, saving a document call in the panel</li> <li>the variable docIndex can be used with viewScope.approveIds.get() to get access to the ID too</li> <li>you could easily extend the example instead of Stings in the vector use a custom object (bean) and get rid of the data sources (might eventually help performance) if you get all fields into the view, so you can continue to use the viewNavigator</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload