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

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

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

Listbox.renderItem介绍

[英]Renders the specified Listitem if not loaded yet, with #getItemRenderer.

It does nothing if #getModel returns null. In other words, it is meaningful only if live data model is used.
[中]如果尚未加载,则使用#getItemRenderer呈现指定的Listitem。
如果#getModel返回null,它将不执行任何操作。换句话说,只有当使用实时数据模型时,它才有意义。

代码示例

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

private void saveGridState() {
  selectedProblems.clear();
  
  for (Object object : lbProblems.getSelectedItems()) {
    Listitem item = (Listitem) object;
    lbProblems.renderItem(item);
    selectedProblems.add((Problem) item.getValue());
  }
}

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

private Problem problemFromRow(int row) {
  Listitem item = lbProblems.getItemAtIndex(row);
  lbProblems.renderItem(item);
  return (Problem) item.getValue();
}

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

private TestItem getSelectedTest() {
  Listitem item = lbTests.getSelectedItem();
  
  if (item != null) {
    lbTests.renderItem(item);
    return (TestItem) item.getValue();
  } else {
    return null;
  }
}

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

/**
 * Returns a list of DTO objects.
 *
 * @param selectedOnly If true, only selected objects are returned.
 * @return List of DTO objects.
 */
protected List<M> getObjects(boolean selectedOnly) {
  List<Listitem> items = getItems(selectedOnly);
  List<M> objects = new ArrayList<M>(items.size());
  
  for (Listitem item : items) {
    M value = item.getValue();
    
    if (value == null) {
      listBox.renderItem(item);
      value = item.getValue();
    }
    
    objects.add(value);
  }
  
  return objects;
}

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

/**
 * Selects the list box item corresponding to the specified filter.
 * 
 * @param lb List box to search.
 * @param filter The filter whose associated list item is to be selected.
 * @return True if the item was successfully selected.
 */
private boolean selectFilter(Listbox lb, AbstractPatientListFilter filter) {
  if (filter != null) {
    for (Object object : lb.getItems()) {
      Listitem item = (Listitem) object;
      lb.renderItem(item);
      AbstractPatientListFilter flt = (AbstractPatientListFilter) item.getValue();
      
      if (flt != null && filter.equals(flt)) {
        lb.setSelectedItem(item);
        Clients.scrollIntoView(item);
        return true;
      }
    }
  }
  
  return false;
}

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

/**
 * Scroll to document with same header.
 */
public void onSelect$cboHeader() {
  Document doc = cboHeader.getSelectedItem().getValue();
  
  for (Listitem item : listBox.getItems()) {
    Document doc2 = (Document) item.getValue();
    
    if (doc2 == null) {
      listBox.renderItem(item);
      doc2 = (Document) item.getValue();
    }
    
    if (doc == doc2) {
      Clients.scrollIntoView(item);
      break;
    }
  }
}

相关文章