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

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

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

Listbox.setSelectedIndex介绍

[英]Deselects all of the currently selected items and selects the item with the given index.
[中]取消选择所有当前选定的项目,并选择具有给定索引的项目。

代码示例

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

private boolean findParticipant(Object participant) {
  if (participant != null) {
    int i = ListUtil.findListboxData(lstEncounterParticipants, participant);
    
    if (i >= 0) {
      lstEncounterParticipants.setSelectedIndex(i);
      return true;
    }
  }
  
  return false;
}

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

private boolean findProvider(Object provider) {
  if (provider != null) {
    int i = ListUtil.findListboxData(lstEncounterProviders, provider);
    
    if (i >= 0) {
      lstEncounterProviders.setSelectedIndex(i);
      return true;
    }
  }
  
  return false;
}

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

private void restoreGridState() {
  if (selectedItem != null) {
    lbTests.setSelectedIndex(ListUtil.findListboxData(lbTests, selectedItem));
    selectedItem = null;
  }
  
  updateControls();
}

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

/**
 * Deselects all of the currently selected items and selects the given item.
 * <p>
 * It is the same as {@link #setSelectedItem}.
 *
 * @param item
 *            the item to select. If null, all items are deselected.
 */
public void selectItem(Listitem item) {
  if (item == null) {
    setSelectedIndex(-1);
  } else {
    if (item.getParent() != this)
      throw new UiException("Not a child: " + item);
    if (_multiple || !item.isSelected())
      setSelectedIndex(item.getIndex());
  }
}

代码示例来源: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.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.context.encounter

public void refreshProviders() {
  Practitioner provider = getSelectedProvider(lstEncounterProviders);
  ListModel<Practitioner> model = new ListModelList<Practitioner>(encounterProvider.getProviders());
  lstEncounterProviders.setModel((ListModel<?>) null);
  lstEncounterProviders.setModel(model);
  
  if (model.getSize() == 1) {
    lstEncounterProviders.setSelectedIndex(0);
  } else {
    selectFirstProvider(provider, UserContext.getActiveUser(), encounterProvider.getCurrentProvider(),
      encounterProvider.getPrimaryProvider());
  }
  
}

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

@Override
public void doAfterCompose(Component comp) throws Exception {
  super.doAfterCompose(comp);
  String[] subsets = (String[]) arg.get("subsets");
  TermSubset termSubsets = TermUtil.getSubset(null);
  
  for (String subset : subsets) {
    Listitem item = new Listitem(termSubsets.getMemberName(subset));
    item.setValue(subset);
    lbSubset.appendChild(item);
  }
  
  if (subsets.length == 1) {
    pnlSubset.setVisible(false);
    lbSubset.setSelectedIndex(0);
    ((Window) root).getCaption().setLabel(lbSubset.getSelectedItem().getLabel());
  }
  
  treeSearch.setItemRenderer(termMatchRenderer);
}

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

public void loadEncounterParticipants(Encounter encounter) {
  encounterParticipantsModel.clear();
  encounterParticipantsModel.addAll(encounter.getParticipant());
  currentParticipant = EncounterParticipantContext.getActiveParticipant();
  encounterParticipantRenderer.setPrimaryParticipant(EncounterUtil.getPrimaryParticipant(encounter));
  
  if (encounterParticipantsModel.getSize() == 1) {
    lstEncounterParticipants.setSelectedIndex(0);
  } else {
    selectFirstParticipant(UserContext.getActiveUser(), currentParticipant, getPrimaryParticipant());
  }
  
  participantsModified = false;
  primaryModified = false;
}

代码示例来源:origin: org.carewebframework/org.carewebframework.vista.security.impl

j_domain.setSelectedIndex(0);

代码示例来源:origin: org.carewebframework/org.carewebframework.security.spring.core

lstDomain.setSelectedIndex(0);

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

setSelectedIndex(index);
  setFocusIndex(offset < 0 ? pageSize - 1 : offset);
} else {

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

if (!_ignoreDataSelectionEvent) {
  if (event.getIndex0() > -1) {
    setSelectedIndex(event.getIndex0());

相关文章