private ProblemFilter getFilter() { return (ProblemFilter) cboFilter.getSelectedItem().getValue(); }
private void setFilter(ProblemFilter filter) { for (Object item : cboFilter.getItems()) { Comboitem ci = (Comboitem) item; if (ci.getValue() == filter) { cboFilter.setSelectedItem(ci); break; } } }
/** * Returns date type from picker. * * @return The date type. */ protected DateType getDateType() { Comboitem item = dateTypePicker == null ? null : dateTypePicker.getSelectedItem(); return item == null ? dateFilter.getDateType() : (DateType) item.getValue(); }
/** * Returns the currently active category filter. * * @return The active category filter. */ private DocumentCategory getCurrentFilter() { return fixedFilter != null ? fixedFilter : cboFilter.getSelectedIndex() > 0 ? (DocumentCategory) cboFilter.getSelectedItem().getValue() : null; }
public Object coerceToBean(Object val, Component comp, BindContext ctx) { if (val != null) { final Combobox lbx = (Combobox) comp; final ListModel<?> model = lbx.getModel(); if (model != null && !(model instanceof Selectable)) { throw new UiException("model doesn't implement Selectable"); } if (model != null) { Set<?> selection = ((Selectable<?>) model).getSelection(); if (selection == null || selection.size() == 0) return null; return selection.iterator().next(); } else { //no model return ((Comboitem) val).getValue(); } } return null; }
public void onSelect$lstLocation() { Listitem item = lstLocation.getSelectedItem(); String sc = (String) item.getAttribute("sc"); if (sc.isEmpty()) { cboServiceCategory.setSelectedItem(null); } else { for (Object obj : cboServiceCategory.getItems()) { if (sc.equals(((Comboitem) obj).getValue())) { cboServiceCategory.setSelectedItem((Comboitem) obj); break; } } } }
public void onSelect$lstLocation() { Listitem item = lstLocation.getSelectedItem(); String sc = (String) item.getAttribute("sc"); if (sc.isEmpty()) { cboServiceCategory.setSelectedItem(null); } else { for (Comboitem ci : cboServiceCategory.getItems()) { if (sc.equals(ci.getValue())) { cboServiceCategory.setSelectedItem(ci); break; } } } statusChanged(); }
final Comboitem ci = (Comboitem) it.next(); Object bean = ci.getValue();
@Override protected Encounter getEncounterInternal() { if (!isComplete()) { return null; } Listitem item = lstLocation.getSelectedItem(); String locid = item == null ? null : (String) item.getValue(); Location location = locid != null ? DomainFactoryRegistry.fetchObject(Location.class, locid) : null; Comboitem cboitem = cboServiceCategory.getSelectedItem(); String sc = cboitem == null ? null : (String) cboitem.getValue(); Date date = datEncounter.getDate(); Encounter encounter = EncounterUtil.create(mainController.patient, date, location, sc); if (chkForceCreate.isChecked()) { mainController.flags.add(EncounterFlag.FORCE); } else { mainController.flags.remove(EncounterFlag.FORCE); } return encounter; }
/** * 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; } } }
/** * @since 3.0.2 */ public Object coerceToBean(Object val, Component comp) { final Combobox cbbox = (Combobox) comp; if (Executions.getCurrent().getAttribute("zkoss.zkplus.databind.ON_SELECT" + cbbox.getUuid()) != null) { //bug #2140491 //triggered by coerceToUi(), ignore this Executions.getCurrent().removeAttribute("zkoss.zkplus.databind.ON_SELECT" + cbbox.getUuid()); return TypeConverter.IGNORE; } if (val != null) { final ListModel model = cbbox.getModel(); //Bug #2010389 //1. loadAll //2. setModel (by 1.), post onInitRender. //3. setSelectedItem (by 1.), coerceToUi, post onSelect with OLD Comboitem. //4. onInitRender(by 2.), syncModel and reconstruct new Comboitem(s) list, fire onInitRenderLater //** 5. save (by 3.), coreceToBean with OLD Comboitem, cannot locate the index with indexOf() //6. onInitRenderLater(by 4.), setSelectedItem, coerceToUi, post onSelect with new Comboitem //no model case, assume Comboitem.value to be used with selectedItem return model != null ? model.getElementAt(cbbox.getItems().indexOf(val)) : ((Comboitem) val).getValue(); } return null; }
/** * @see org.carewebframework.ui.FrameworkController#doAfterCompose(org.zkoss.zk.ui.Component) */ @Override public void doAfterCompose(final Component comp) throws Exception { super.doAfterCompose(comp); bgoSecurity = BgoUtil.initSecurity("BGO DISABLE PROB LIST EDITING", "BGOZ PROBLEM LIST EDIT"); lbProblems.setItemRenderer(problemRenderer); RowComparator.autowireColumnComparators(lbProblems.getListhead().getChildren()); m_bPersHistAndAct = SecurityUtil.isGranted("BGO PL INCLUDE PERS HIST W ACT"); for (Object item : cboFilter.getItems()) { Comboitem ci = (Comboitem) item; ProblemFilter filter = ProblemFilter.valueOf(ci.getValue().toString()); ci.setValue(m_bPersHistAndAct && filter == ProblemFilter.ACTIVE ? ProblemFilter.ACTIVE_PERSONAL : filter); } setFilter(getDefaultFilter()); getAppFramework().registerObject(patientContextEventHandler); getAppFramework().registerObject(encounterContextEventHandler); patientContextEventHandler.committed(); log.trace("Controller composed"); }
if (val.equals(li.getValue())) { return li;
Comboitem cboitem = cboServiceCategory.getSelectedItem(); Date date = datEncounter.getDate(); CodeableConceptDt sc = EncounterUtil.createServiceCategory((String) cboitem.getValue(), cboitem.getLabel(), cboitem.getTooltiptext()); encounter = EncounterUtil.create(date, location, sc);
if (nci.getValue() == null) //template might set it nci.setValue(data); item.setAttribute(Attributes.MODEL_RENDERAS, nci);
/** * Update the scheduled notification with new input values and send to the server, then close * the dialog if successful. */ public void onClick$btnOK() { if (validate()) { notification.setDeliveryDate(new FMDate(dtbDelivery.getDate())); notification.setDfn(chkAssociate.isChecked() ? (String) chkAssociate.getValue() : null); notification.setPatientName(chkAssociate.isChecked() ? lblPatient.getValue() : null); notification.setSubject(txtSubject.getValue()); notification.setPriority((Priority) cboPriority.getSelectedItem().getValue()); List<String> message = StrUtil.toList(txtMessage.getText()); if (service.scheduleNotification(notification, message, recipients)) { root.setAttribute("notification", notification); root.detach(); } else { PromptDialog.showError("@vistanotification.schedule.save.failure"); } } }
if (nci.getValue() == null) //template might set it nci.setValue(data); item.setAttribute(Attributes.MODEL_RENDERAS, nci);