public AddNodeWindow(AbstractQuestionRelation p) { this.setParent(p); // create ui from template Executions.createComponents("/WEB-INF/zk/survey/design/AddNodeWindow.zul", this, null); Selectors.wireVariables(this, this, Selectors.newVariableResolvers(getClass(), Div.class)); Selectors.wireComponents(this, this, false); Selectors.wireEventListeners(this, this); // type box and default selection ntds = nodeRO.getNodeTypeDescriptions(); ListModelList<String> typeModel = new ListModelList<String>(); for (Map<String, String> ntd : ntds) { String nodeTypeLabel = ntd.get("label"); typeModel.add(nodeTypeLabel); } String defaultContactType = p.getQuestion().getDefaultNewContactType(); if (defaultContactType != null) { Map<String, String> ntd = GeneralUtil.getNodeDescription(ntds, defaultContactType); if (ntd != null) { String nodeTypeLabel = ntd.get("label"); typeModel.addToSelection(nodeTypeLabel); } } typeBox.setModel(typeModel); onNodeTypeChanged(); this.setWidth("200px"); this.setVflex("1"); this.setClosable(true); }
private void doSimpan() throws InterruptedException { TPermohonan tPermohonan = gettPermohonan(); Mttr mttr = new Mttr(); doWriteComponentsToBean(tPermohonan, mttr); try { String uploadeFileName = null; if (getUploadMedia() != null) { uploadeFileName = getUploadMedia().getName(); } getPermohonanService() .simpanAllTPermohonan( uploadeFileName, tPermohonan, mttr, getUserWorkspace().getUserSession().getEmployeeRole()); TVerifikasi tVerifikasi = getPermohonanService() .getTVerifikasiByTIdossVerifikasiId(gettPermohonan().getT_idoss_permohonan_id()); doWriteComponentsToBeanVer(tVerifikasi); getVerifikasiService().saveOrUpdateTVerifikasi(tVerifikasi); } catch (DataAccessException e) { String message = e.getMessage(); String title = Labels.getLabel("message_Error"); MultiLineMessageBox.doSetTemplate(); MultiLineMessageBox.show(message, title, MultiLineMessageBox.OK, "ERROR", true); } ListModelList lml = (ListModelList) listbox_DaftarPermohonan.getListModel(); // Check if the object is new or updated // -1 means that the obj is not in the list, so it's new. if (lml.indexOf(tPermohonan) == -1) { lml.add(tPermohonan); } else { lml.set(lml.indexOf(tPermohonan), tPermohonan); } lml.sort(new TPermohonanComparator(), true); }
public void onCreate$window_Permohonan(Event event) throws Exception { if (logger.isDebugEnabled()) { logger.debug("--> " + event.toString()); } doCheckRights(); Map<String, Object> args = getCreationArgsMap(event); if (args.containsKey("tPermohonan")) { TPermohonan tPermohonan = (TPermohonan) args.get("tPermohonan"); settPermohonan(tPermohonan); } else { settPermohonan(null); } if (args.containsKey("permohonanBaruCtrl")) { permohonanBaruCtrl = (PermohonanBaruCtrl) args.get("permohonanBaruCtrl"); } else { permohonanBaruCtrl = null; } if (args.containsKey("listbox_DaftarPermohonan")) { listbox_DaftarPermohonan = (Listbox) args.get("listbox_DaftarPermohonan"); } else { listbox_DaftarPermohonan = null; } if (getPelaksanaanGangguanService().getEmployeeName() != null) { ListModelList lmlNamaPelaksana = new ListModelList(getPelaksanaanGangguanService().getEmployeeName()); VHrEmployeePelaksana pelaksana = new VHrEmployeePelaksana(); pelaksana.setEmployee_name("Silakan pilih"); pelaksana.setEmployee_no("555"); lmlNamaPelaksana.add(0, pelaksana); listbox_NamaPelaksana.setModel(lmlNamaPelaksana); listbox_NamaPelaksana.setItemRenderer(new PelaksanaListModelItemRenderer()); } doShowDialog(gettPermohonan(), gettVerifikasi()); }