Example #1
0
 @SuppressWarnings("unchecked")
 @UICommand
 public String findScreenerByNamePattern() {
   String pattern = getFullNamePattern();
   if (!StringUtils.isEmpty(pattern)) {
     _screenerSearchResults.searchAll(
         "Screeners matching "
             + pattern); // potentially poor performance, but "correct", as it always searches
                         // latest additions and changes to users
     TableColumn<ScreeningRoomUser, String> column =
         (TableColumn<ScreeningRoomUser, String>)
             _screenerSearchResults.getColumnManager().getColumn("Name");
     // Note: the assumption is that alphabetic sort when searching on name is desired
     _screenerSearchResults.getColumnManager().setSortColumn(column);
     _screenerSearchResults.getColumnManager().setSortDirection(SortDirection.ASCENDING);
     column.resetCriteria().setOperatorAndValue(Operator.TEXT_LIKE, pattern);
     if (_screenerSearchResults.getRowCount() == 0) {
       showMessage("users.noUserWithMatchingName", pattern);
       resetSearchFields(); // if we don't reset now, and the user decides to not search again, the
                            // search criteria remain in the input fields
     } else if (_screenerSearchResults.getRowCount() == 1) {
       _screenerSearchResults.getRowsPerPageSelector().setSelection(1);
       resetSearchFields();
     } else {
       _screenerSearchResults
           .getRowsPerPageSelector()
           .setSelection(_screenerSearchResults.getRowsPerPageSelector().getDefaultSelection());
       resetSearchFields();
     }
     return BROWSE_SCREENERS;
   } else {
     showMessage("users.screenerNameRequired");
   }
   return REDISPLAY_PAGE_ACTION_RESULT;
 }
Example #2
0
 @UICommand
 public String browseLibraryPlatesDataLoaded() {
   _libraryPlateSearchResults.searchLibraryPlatesScreenedByScreen(getEntity());
   TableColumn<LibraryPlate, Boolean> isDataLoadedCcolumn =
       (TableColumn<LibraryPlate, Boolean>)
           _libraryPlateSearchResults.getColumnManager().getColumn("Data Loaded");
   isDataLoadedCcolumn.getCriterion().setOperatorAndValue(Operator.EQUAL, Boolean.TRUE);
   return BROWSE_LIBRARY_PLATES_SCREENED;
 }