org.zkoss.zul.Listbox.clearSelection()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中org.zkoss.zul.Listbox.clearSelection()方法的一些代码示例,展示了Listbox.clearSelection()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Listbox.clearSelection()方法的具体详情如下:
包路径:org.zkoss.zul.Listbox
类名称:Listbox
方法名:clearSelection

Listbox.clearSelection介绍

[英]Clears the selection.
[中]清除所选内容。

代码示例

代码示例来源:origin: org.carewebframework/org.carewebframework.cal.ui.reporting

/**
 * Clear the current selection, if any.
 */
protected void clearSelection() {
  listBox.clearSelection();
}

代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.notification

/**
 * Clears all selections.
 */
private void clearSelection() {
  lstNotification.clearSelection();
  updateControls(false);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.cal.ui.patientselection.v1

/**
 * Set the active patient when selected from the list.
 * 
 * @param event The onSelect event.
 */
public void onSelect$lstPatientList(Event event) {
  lstSearch.clearSelection();
  setActivePatient(event);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.cal.ui.patientselection.v1

public void onSelect$lstSearch(Event event) {
  lstPatientList.clearSelection();
  setActivePatient(event);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.rpms.ui.problem

private void restoreGridState() {
  lbProblems.clearSelection();
  
  for (Object object : lbProblems.getItems()) {
    Listitem item = (Listitem) object;
    lbProblems.renderItem(item);
    
    if (selectedProblems.contains(item.getValue())) {
      item.setSelected(true);
    }
  }
  
  selectedProblems.clear();
  updateControls();
}

代码示例来源:origin: org.carewebframework/org.carewebframework.cal.ui.patientselection.v1

private void displaySearchMessage(String message) {
  lstSearch.clearSelection();
  lstSearch.setModel((ListModelList<?>) null);
  lstSearch.getItems().clear();
  
  if (message != null) {
    lstSearch.appendItem(message, null).setTooltiptext(message);
  }
  
  Clients.scrollIntoView(lstSearch.getFirstChild());
}

代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.vitals

private void setSelectedRow(int index) {
  if (index < 0) {
    selectedRow = -1;
    selectedItem = "";
    lstVitals.clearSelection();
    chkPercentiles.setVisible(false);
  } else {
    selectedRow = index;
    selectedItem = getValue(0, index);
    lstVitals.setSelectedIndex(index);
    chkPercentiles.setVisible(percentiles.containsKey(getObject(0, index)));
  }
  
  chartData();
}

代码示例来源:origin: org.zkoss.zk/zul

/**
   * Override to remove unnecessary Listitem re-indexing (when ROD is on, clear() is called frequently). 
   */
  public void clear() {
    final boolean oldFlag = setReplacingItem(true);
    try {
      //Bug ZK-1834: if there are selected items, clear first.
      if (getSelectedCount() > 0) {
        clearSelection();
        // Bug ZK-1842 Listbox scroll bug listheader sort 
        _anchorLeft = _anchorTop = 0;
      }
      super.clear();
    } finally {
      setReplacingItem(oldFlag);
    }
  }
};

代码示例来源:origin: org.carewebframework/org.carewebframework.cal.ui.patientselection.v1

/**
 * Handles a deferred request to show the dialog.
 * 
 * @param event The onShow event.
 * @throws Exception Unspecified exception.
 */
public void onShow(Event event) throws Exception {
  root.removeAttribute(Constants.SELECTED_PATIENT_ATTRIB);
  lstSearch.clearSelection();
  onCheck$rgrpLists();
  Events.echoEvent(Events.ON_FOCUS, root, null);
  
  if (!root.inModal()) {
    root.doModal();
  }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.cwad

public void onClick$lstAllergies() {
  Listitem item = lstAllergies.getSelectedItem();
  
  if (item != null) {
    lstAllergies.clearSelection();
    String s = item.getValue();
    List<String> lst = broker.callRPCList("RGCWARCV DETAIL", null, patientId, StrUtil.piece(s, U));
    ReportBox.modal(lst, code2Text('A'), allowPrint);
  }
}

代码示例来源:origin: org.zkoss.zk/zul

/**
 * Deselects the given item without deselecting other items.
 *
 * <p>Notice that if you assign a model to a listbox ({@link #setModel}),
 * you shall not invoke this method directly. Rather, use {@link Selectable}
 * instead.
 */
public void removeItemFromSelection(Listitem item) {
  if (item.getParent() != this)
    throw new UiException("Not a child: " + item);
  if (item.isSelected()) {
    if (!_multiple) {
      clearSelection();
    } else {
      item.setSelectedDirectly(false);
      _selItems.remove(item);
      fixSelectedIndex(0);
      // ZK-2113: should be same as normal mold
      //				if (inSelectMold()) {
      //					item.smartUpdate("selected", false);
      //				} else {
      //				}
      smartUpdateSelection();
    }
  }
}

代码示例来源:origin: org.zkoss.zk/zul

final int expSelCnt = selObjs.size();
if (expSelCnt == 0) {
  clearSelection();
  return;

代码示例来源:origin: org.carewebframework/org.carewebframework.cal.ui.patientselection.v1

/**
 * Search for matching patients based on user input.
 */
private void doSearch() {
  log.trace("Start doSearch()");
  Clients.clearBusy();
  displaySearchMessage(null);
  
  try {
    lstSearch.clearSelection();
    List<Patient> matches = PatientSearchUtil.execute(edtSearch.getValue(), 100);
    
    if (matches != null) {
      lstSearch.setModel(new ListModelList<Patient>(matches));
      
      if (matches.size() == 1) {
        lstSearch.setSelectedIndex(0);
      }
    }
  } catch (Exception e) {
    displaySearchMessage(e.getMessage());
  }
  
  edtSearch.setFocus(true);
  edtSearch.select();
  Events.postEvent(Events.ON_SELECT, lstSearch, null);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.vista.ui.cwad

public void onClick$lstNotes() {
  Listitem item = lstNotes.getSelectedItem();
  
  if (item != null) {
    lstNotes.clearSelection();
    String s = item.getValue();
    char c = StrUtil.piece(s, StrUtil.U, 2).charAt(0);
    List<String> lst = null;
    String patientId = PatientContext.getActivePatient().getId().getIdPart();
    
    switch (c) {
      case 'A':
        lst = broker.callRPCList("RGCWCACV DETAIL", null, patientId);
        break;
      
      case 'F':
        lst = broker.callRPCList("RGCWCACV PRF", null, patientId, StrUtil.piece(s, StrUtil.U));
        break;
      
      default:
        lst = broker.callRPCList("TIU GET RECORD TEXT", null, StrUtil.piece(s, StrUtil.U));
        break;
    }
    
    if (lst != null && !lst.isEmpty()) {
      ReportBox.modal(lst, code2Text(c), allowPrint);
    }
  }
}

代码示例来源:origin: org.zkoss.zk/zul

jsel = -1;
if (jsel < 0) { // unselect all
  clearSelection();
} else if (jsel != _jsel || (_multiple && _selItems.size() > 1) || !_selItems.contains(getItemAtIndex(_jsel))) {
  for (Listitem item : _selItems) {

代码示例来源:origin: org.zkoss.zk/zul

clearSelection();
if (_model != null)
  ((Selectable) _model).clearSelection();

相关文章