public void viewReport() throws Exception { try { JadwalDosenDAO dao = new JadwalDosenDAOImpl(); if (cmbNamaDosen.getValue() != null && cmbProgdi.getValue() != null && !cmbTahun.getSelectedItem().getValue().toString().isEmpty() && cmbSemester.getValue() != null) { datas = dao.getJadwalDosen( (Dosen) cmbNamaDosen.getSelectedItem().getValue(), (ProgramStudi) cmbProgdi.getSelectedItem().getValue(), cmbTahun.getSelectedItem().getValue().toString(), Integer.valueOf(cmbSemester.getSelectedItem().getValue().toString())); lstData.getItems().clear(); for (JadwalDosen jd : datas) { Listitem item = new Listitem(); item.setValue(jd); item.appendChild(new Listcell(jd.getJam())); item.appendChild(new Listcell(jd.getSenin())); item.appendChild(new Listcell(jd.getSelasa())); item.appendChild(new Listcell(jd.getRabu())); item.appendChild(new Listcell(jd.getKamis())); item.appendChild(new Listcell(jd.getJumat())); item.appendChild(new Listcell(jd.getSabtu())); lstData.appendChild(item); } btnExport.setDisabled(false); } else { Messagebox.show("Silahkan Input Parameter dengan benar"); btnExport.setDisabled(true); } } catch (Exception ex) { Messagebox.show("Telah terjadi kesalahan.."); } }
// Metodo para buscar // public void buscarDatos() throws Exception { try { Map<String, Object> parameters = new HashMap<String, Object>(); String value = tbxValue.getValue().trim().toUpperCase(); parameters.put("codigo_empresa", codigo_empresa); parameters.put("codigo_sucursal", codigo_sucursal); String parameter = lbxParameter.getSelectedItem().getValue().toString(); parameters.put("parameter", parameter); parameters.put("value", "%" + value + "%"); parameters.put("limite_paginado", "limit 25 offset 0"); List<Maestro_manual> lista_datos = maestro_manualService.listar(parameters); listboxResultado.getItems().clear(); divPopups.getChildren().clear(); for (Maestro_manual maestro_manual : lista_datos) { listboxResultado.appendChild(crearFilas(maestro_manual, this)); } listboxResultado.applyProperties(); listboxResultado.invalidate(); } catch (Exception e) { MensajesUtil.mensajeError(e, "", this); } }
public void viewReport() throws Exception { try { listb.getItems().clear(); DosenSedangMenempuhStudiDAO dao = new DosenSedangMenempuhStudiDAOImpl(); datas = dao.getData( (UKProgramStudi) cmbProgdi.getSelectedItem().getValue(), (JenjangStudi) cmbJenjangStudi.getSelectedItem().getValue()); for (DosenSedangMenempuhStudi o : datas) { Listitem li = new Listitem(); Listcell cell = new Listcell(o.getNama()); li.appendChild(cell); cell = new Listcell(o.getProdi()); li.appendChild(cell); cell = new Listcell(o.getJenjangStudi()); li.appendChild(cell); cell = new Listcell(o.getTempat()); li.appendChild(cell); listb.appendChild(li); } btnExport.setDisabled(false); } catch (Exception ex) { ex.printStackTrace(); Messagebox.show(ex.getMessage()); } }
public void listarParameter() { lbxParameter.getChildren().clear(); Listitem listitem = new Listitem(); // listitem.setValue("id_manual"); // listitem.setLabel("Id_manual"); // lbxParameter.appendChild(listitem); // listitem = new Listitem(); listitem.setValue("manual"); listitem.setLabel("Manual"); lbxParameter.appendChild(listitem); // listitem = new Listitem(); // listitem.setValue("tipo_manual"); // listitem.setLabel("Tipo_manual"); // lbxParameter.appendChild(listitem); // // listitem = new Listitem(); // listitem.setValue("tipo_moneda"); // listitem.setLabel("Tipo_moneda"); // lbxParameter.appendChild(listitem); if (lbxParameter.getItemCount() > 0) { lbxParameter.setSelectedIndex(0); } }
@Listen("onClick=#btn_atualiza, #btn_aberto, #btn_fechado") public void criaLista(Event event) { String itemId = event.getTarget().getId(); ArrayList<Edital> editais = new ArrayList<>(); if (itemId.equals("btn_atualiza")) { editais.addAll(new EditalDAO().getAll()); } else if (itemId.equals("btn_aberto")) { editais.addAll(new EditalDAO().getOpened()); } else { editais.addAll(new EditalDAO().getClosed()); } // remove filhos da listbox listar_edital.getItems().clear(); ListModelList<Edital> editalModel = new ListModelList<Edital>(editais); // cria model listar_edital.setModel(editalModel); // recria listbox try { Listhead lh = new Listhead(); lh.appendChild(new Listheader("código edital")); lh.appendChild(new Listheader("projeto")); lh.appendChild(new Listheader("número de vagas")); lh.appendChild(new Listheader("data inicio")); lh.appendChild(new Listheader("data final")); listar_edital.appendChild(lh); } catch (Exception e) { // TODO: handle exception } listar_edital.setItemRenderer( new ListitemRenderer() { @Override public void render(Listitem listitem, Object data, int arg2) throws Exception { final Edital edital = (Edital) data; final Projeto projeto = new ProjetoDAO().getOneByCod(edital.getProjeto_cod()); new Listcell(String.valueOf(edital.getCod())).setParent(listitem); new Listcell(projeto.getCod() + "-" + projeto.getDescricao()).setParent(listitem); new Listcell(String.valueOf(edital.getN_vagas())).setParent(listitem); new Listcell(edital.getData_inicio().toString()).setParent(listitem); new Listcell(edital.getData_fim().toString()).setParent(listitem); } }); }
public void listarParameter() { lbxParameter.getChildren().clear(); Listitem listitem = new Listitem(); listitem.setValue("codigo"); listitem.setLabel("Codigo"); lbxParameter.appendChild(listitem); listitem = new Listitem(); listitem.setValue("numero_solicitud"); listitem.setLabel("Numero_solicitud"); lbxParameter.appendChild(listitem); if (lbxParameter.getItemCount() > 0) { lbxParameter.setSelectedIndex(0); } }
public void listarParameter() { lbxParameter.getChildren().clear(); Listitem listitem = new Listitem(); listitem.setValue("codigo_ficha"); listitem.setLabel("Codigo_ficha"); lbxParameter.appendChild(listitem); listitem = new Listitem(); listitem.setValue("identificacion"); listitem.setLabel("Identificacion"); lbxParameter.appendChild(listitem); if (lbxParameter.getItemCount() > 0) { lbxParameter.setSelectedIndex(0); } }
// public Listitem agregarDetail(IBeanAbstracto dto, Listbox lista, int // span, // String widthEstado, boolean aplicaEstado, boolean aplicaDetail, // String lblcaption, String... nobreColumnas) { // // Listitem detail = new Listitem(); // Listhead columnas = new Listhead(); // Groupbox gbox = new Groupbox(); // Caption caption = new Caption(lblcaption); // gbox.appendChild(caption); // // Listcell cell1 = new Listcell(); // Listcell cell2 = new Listcell(); // cell2.setSpan(span); // if (aplicaDetail) { // Listheader deta = new Listheader(); // deta.setWidth("20px"); // deta.setAlign("center"); // columnas.appendChild(deta); // } // // for (String nombreColumna : nobreColumnas) { // columnas.appendChild(new Listheader(nombreColumna)); // } // if (aplicaEstado) { // if (widthEstado != "" && widthEstado != null) { // Listheader estado = new Listheader("Estado"); // estado.setAlign(CENTER); // estado.setWidth(widthEstado); // columnas.appendChild(estado); // } else { // Listheader estado = new Listheader("Estado"); // estado.setAlign(CENTER); // estado.setWidth("70px"); // columnas.appendChild(estado); // } // // } // lista.appendChild(columnas); // gbox.appendChild(lista); // gbox.setStyle("overflow:auto"); // cell2.appendChild(gbox); // detail.appendChild(cell1); // detail.appendChild(cell2); // detail.setVisible(false); // // return detail; // } // @SuppressWarnings("deprecation") public Listitem agregarDetail( IBeanAbstracto dto, Listbox lista, int span, String widthEstado, String lblCaption, boolean aplicaEstado, boolean aplicaDetail, String... nobreColumnas) { Listitem detail = new Listitem(); Listhead columnas = new Listhead(); Groupbox gbox = new Groupbox(); Caption caption = new Caption(); if (lblCaption != null) caption.setLabel(lblCaption); Listcell cell1 = new Listcell(); Listcell cell2 = new Listcell(); cell2.setSpan(span); if (aplicaDetail) { Listheader deta = new Listheader(); deta.setWidth("30px"); deta.setAlign("center"); columnas.appendChild(deta); } for (String nombreColumna : nobreColumnas) { columnas.appendChild(new Listheader(nombreColumna)); } if (aplicaEstado) { if (widthEstado != "" && widthEstado != null) { Listheader estado = new Listheader("Estado"); estado.setAlign(CENTER); estado.setWidth(widthEstado); columnas.appendChild(estado); } else { Listheader estado = new Listheader("Estado"); estado.setAlign(CENTER); estado.setWidth("70px"); columnas.appendChild(estado); } } lista.setFixedLayout(true); lista.appendChild(columnas); gbox.appendChild(caption); gbox.appendChild(lista); gbox.setHflex("true"); gbox.setContentStyle("overflow-x:auto"); cell2.appendChild(gbox); detail.appendChild(cell1); detail.appendChild(cell2); detail.setVisible(false); return detail; }
public void preencheListbox() { disponiveis = listaDisponiveis(); selecionados = listaSelecionados(); lbDisponiveis.getChildren().clear(); lbDisponiveis.appendChild(defineCabecalho()); lbSelecionados.getChildren().clear(); lbSelecionados.appendChild(defineCabecalho()); for (T objeto : disponiveis) { Listitem item = criaItem(objeto); if (selecionados.contains(objeto)) { item.setParent(lbSelecionados); } else { item.setParent(lbDisponiveis); } } }
public void onClick$delete() { Object[] items = listbox2.getSelectedItems().toArray(); for (int i = 0; i < items.length; i++) { Listitem item = (Listitem) items[i]; if (listbox1.getItemCount() == 0) { listbox1.appendChild(item); } else { Listitem topItem = (Listitem) listbox1.getItems().get(0); listbox1.insertBefore(item, topItem); } } }
public ProfileComponent() { super(); final PlayerProfileData player = getPlayerFacade().getCurrentPlayer(); final Grid profileGrid = new Grid(); profileGrid.setSclass("profileGrid"); final Rows profileRows = new Rows(); profileGrid.appendChild(profileRows); final Row idRow = new Row(); idRow.setSclass("profileRow"); idRow.appendChild(new Label(Labels.getLabel("profile.id"))); idRow.appendChild(new Label(player.getId())); profileRows.appendChild(idRow); final Row nameRow = new Row(); nameRow.setSclass("profileRow"); nameRow.appendChild(new Label(Labels.getLabel("profile.name"))); final Textbox nameBox = new Textbox(player.getName()); nameBox.setConstraint( new SimpleConstraint(SimpleConstraint.NO_EMPTY, Labels.getLabel("register.error.noname"))); nameRow.appendChild(nameBox); profileRows.appendChild(nameRow); final Row mailRow = new Row(); mailRow.setSclass("profileRow"); mailRow.appendChild(new Label(Labels.getLabel("profile.email"))); final Textbox mailBox = new Textbox(player.getEMail()); mailBox.setConstraint("/.+@.+\\.[a-z]+/: " + Labels.getLabel("register.error.noemail")); mailRow.appendChild(mailBox); profileRows.appendChild(mailRow); final Row pwdRow = new Row(); pwdRow.setSclass("profileRow"); pwdRow.appendChild(new Label(Labels.getLabel("profile.password"))); final Textbox pwdBox = new Textbox(player.getPassword()); // pwdBox.setConstraint(new SimpleConstraint(SimpleConstraint.NO_EMPTY, // Labels.getLabel("register.error.nopassword"))); pwdBox.setType("password"); pwdRow.appendChild(pwdBox); profileRows.appendChild(pwdRow); final Row pwd2Row = new Row(); pwd2Row.setSclass("profileRow"); pwd2Row.appendChild(new Label(Labels.getLabel("profile.passwordagain"))); final Textbox pwd2Box = new Textbox(player.getPassword()); pwd2Box.setConstraint( new Constraint() { @Override public void validate(final Component comp, final Object value) throws WrongValueException { if (!(pwdBox.getValue().equals(value))) { throw new WrongValueException( comp, Labels.getLabel("register.error.unequalpassword")); } } }); pwd2Box.setType("password"); pwd2Row.appendChild(pwd2Box); profileRows.appendChild(pwd2Row); final Row countryRow = new Row(); countryRow.setSclass("profileRow"); countryRow.appendChild(new Label(Labels.getLabel("profile.country"))); final Combobox countryBox = new Combobox(); countryBox.setConstraint( new SimpleConstraint( SimpleConstraint.NO_EMPTY, Labels.getLabel("register.error.nocountry"))); countryBox.setAutodrop(true); countryBox.setReadonly(true); fillCombo(countryBox, player.getLocale()); countryRow.appendChild(countryBox); profileRows.appendChild(countryRow); final Row avCompetitionsRow = new Row(); avCompetitionsRow.setSclass("competitionsRow"); avCompetitionsRow.appendChild(new Label(Labels.getLabel("profile.availableCompetitions"))); final Listbox listbox = new Listbox(); listbox.setSclass("competitionsListbox"); avCompetitionsRow.appendChild(listbox); listbox.setCheckmark(true); listbox.setMultiple(true); final List<CompetitionData> comps = getPlayerFacade().getAllCompetitions(); for (final CompetitionData cmpData : comps) { final Listitem listItem = new Listitem(cmpData.getName()); listItem.setValue(cmpData); listItem.setSelected(cmpData.isActive()); listItem.setDisabled( !cmpData.isDeactivatable() || (cmpData.isCurrentCompetition() && comps.size() != 1)); listbox.appendChild(listItem); } profileRows.appendChild(avCompetitionsRow); final Row buttonRow = new Row(); buttonRow.setSclass("profileRow"); final Button button = new Button(Labels.getLabel("profile.submit")); button.addEventListener( Events.ON_CLICK, new EventListener() { @Override public void onEvent(final Event event) { player.setEMail(mailBox.getValue()); player.setName(nameBox.getValue()); if (StringUtils.isNotBlank(pwdBox.getValue()) && pwdBox.getValue().equals(pwd2Box.getValue())) { player.setPassword(pwdBox.getValue()); } player.setLocale((Locale) countryBox.getSelectedItem().getValue()); final List<CompetitionData> cmps = new ArrayList<CompetitionData>(); for (final Object listItem : listbox.getSelectedItems()) { if (listItem instanceof Listitem) { final Object value = ((Listitem) listItem).getValue(); if (value instanceof CompetitionData) { cmps.add((CompetitionData) value); } } } getPlayerFacade().setActiveCompetitions(cmps); getPlayerFacade().updatePlayer(player); try { Messagebox.show(Labels.getLabel("profile.update.success")); // TODO proper update mechanism Executions.sendRedirect("/"); } catch (final InterruptedException e) { LOG.warn("Error while showing messagebox: ", e); } } }); buttonRow.appendChild(button); profileRows.appendChild(buttonRow); this.appendChild(profileGrid); final Div detailsDiv = new Div(); detailsDiv.setSclass("rankingUserDetails"); final Img img = new Img(); final Div imgCnt = new Div(); imgCnt.appendChild(img); imgCnt.setSclass("rankingUserDetailsImg"); img.setDynamicProperty("src", player.getPictureUrl()); detailsDiv.appendChild(imgCnt); final Button uploadButton = new Button(Labels.getLabel("profile.upload")); uploadButton.setSclass("btngreen profileUserDetailsUpload"); detailsDiv.appendChild(uploadButton); uploadButton.addEventListener( Events.ON_CLICK, new EventListener() { @Override public void onEvent(final Event event) throws InterruptedException { final Object media = Fileupload.get(); if (media instanceof Image) { final Image image = (Image) media; player.setPictureUrl( getPlayerFacade().uploadProfilePicture(image.getByteData(), image.getName())); img.setDynamicProperty("src", player.getPictureUrl()); } else if (media != null) { Messagebox.show("Not an image: " + media, "Error", Messagebox.OK, Messagebox.ERROR); } } }); this.appendChild(detailsDiv); }
public void adicionarProcedimiento(Map<String, Object> pcd) { String codigo_cups = (String) pcd.get("codigo_cups"); String nombre_procedimiento = (String) pcd.get("nombre_procedimiento"); String codigo_manual = (String) pcd.get("codigo_manual"); Double valor_defecto = 0D; String tipo = lbxTipo_manual.getSelectedItem().getValue().toString(); if (tipo.equals(IConstantes.TIPO_MANUAL_SOAT)) { valor_defecto = (Double) pcd.get("porcentaje_defecto"); } else if (tipo.equals(IConstantes.TIPO_MANUAL_ISS01)) { valor_defecto = (Double) pcd.get("valoriss01_defecto"); } else if (tipo.equals(IConstantes.TIPO_MANUAL_ISS04)) { valor_defecto = (Double) pcd.get("valoriss04_defecto"); } Listitem listitem = new Listitem(); listitem.setValue(pcd); listitem.appendChild(new Listcell()); listitem.appendChild(new Listcell(codigo_cups)); Textbox tbxCodigo_manual = new Textbox(codigo_manual != null ? codigo_manual : codigo_cups); tbxCodigo_manual.setHflex("1"); Listcell listcell = new Listcell(); listcell.appendChild(tbxCodigo_manual); listitem.appendChild(listcell); Res.cargarAutomatica(tbxCodigo_manual, pcd, "codigo_manual", null); pcd.put("codigo_manual", codigo_manual != null ? codigo_manual : codigo_cups); Textbox tbxNombre = new Textbox(nombre_procedimiento); tbxNombre.setHflex("1"); tbxNombre.setReadonly(true); listcell = new Listcell(); listcell.appendChild(tbxNombre); listitem.appendChild(listcell); Double valor = (Double) pcd.get("valor"); Doublebox dbxValor = new Doublebox(); dbxValor.setValue(valor != null ? valor : valor_defecto); dbxValor.setHflex("1"); listcell = new Listcell(); listcell.appendChild(dbxValor); listitem.appendChild(listcell); Res.cargarAutomatica(dbxValor, pcd, "valor", null); pcd.put("valor", valor != null ? valor : valor_defecto); String grupo_uvr = (String) pcd.get("grupo_uvr"); Textbox tbxGrupoUvr = new Textbox(grupo_uvr != null ? grupo_uvr : ""); tbxGrupoUvr.setHflex("1"); listcell = new Listcell(); listcell.appendChild(tbxGrupoUvr); listitem.appendChild(listcell); Res.cargarAutomatica(tbxGrupoUvr, pcd, "grupo_uvr", null); pcd.put("grupo_uvr", grupo_uvr != null ? grupo_uvr : ""); String nro_cuenta = (String) pcd.get("nro_cuenta"); Textbox tbxNro_cuenta = new Textbox(nro_cuenta != null ? nro_cuenta : ""); tbxNro_cuenta.setHflex("1"); listcell = new Listcell(); listcell.appendChild(tbxNro_cuenta); listitem.appendChild(listcell); Res.cargarAutomatica(tbxNro_cuenta, pcd, "nro_cuenta", null); pcd.put("nro_cuenta", nro_cuenta != null ? nro_cuenta : ""); listboxProcedimientos.appendChild(listitem); }
@SuppressWarnings("unchecked") public void carregaInterface() { Vbox candidatos = new Vbox(); candidatos.setParent(this); new Label("Disponíveis:").setParent(candidatos); lbDisponiveis.setParent(candidatos); lbDisponiveis.setHeight("300px"); lbDisponiveis.setRows(10); lbDisponiveis.setMultiple(true); lbDisponiveis.appendChild(defineCabecalho()); botoes.setSpacing("15px"); botoes.setAlign("center"); botoes.setPack("center"); botoes.setParent(this); btSelecionaTodos.setParent(botoes); btSelecionaTodos.setLabel(">>"); btSelecionaTodos.addEventListener( "onClick", new EventListener() { @Override public void onEvent(Event arg0) throws Exception { List<Listitem> itens = new ArrayList<Listitem>(); itens.addAll(lbDisponiveis.getItems()); for (Listitem listitem : itens) { listitem.setParent(lbSelecionados); } } }); btSelecionaUm.setParent(botoes); btSelecionaUm.setLabel(">"); btSelecionaUm.addEventListener( "onClick", new EventListener() { @Override public void onEvent(Event arg0) throws Exception { List<Listitem> itens = new ArrayList<Listitem>(); itens.addAll(lbDisponiveis.getSelectedItems()); for (Listitem listitem : itens) { listitem.setParent(lbSelecionados); } } }); btRemoveUm.setParent(botoes); btRemoveUm.setLabel("<"); btRemoveUm.addEventListener( "onClick", new EventListener() { @Override public void onEvent(Event arg0) throws Exception { List<Listitem> itens = new ArrayList<Listitem>(); itens.addAll(lbSelecionados.getSelectedItems()); for (Listitem listitem : itens) { listitem.setParent(lbDisponiveis); } } }); btRemoveTodos.setParent(botoes); btRemoveTodos.setLabel("<<"); btRemoveTodos.addEventListener( "onClick", new EventListener() { @Override public void onEvent(Event arg0) throws Exception { List<Listitem> itens = new ArrayList<Listitem>(); itens.addAll(lbSelecionados.getItems()); for (Listitem listitem : itens) { listitem.setParent(lbDisponiveis); } } }); Vbox selecionados = new Vbox(); selecionados.setParent(this); new Label("Selecionados:").setParent(selecionados); lbSelecionados.setParent(selecionados); lbSelecionados.setHeight("300px"); lbSelecionados.setMultiple(true); lbSelecionados.appendChild(defineCabecalho()); preencheListbox(); }
public void cari() throws Exception { Connection conn = getConn(); try { PerusahaanDAO dao = new PerusahaanDAOImpl(conn); List<Perusahaan> list = dao.gets((Kecamatan) cmbKecamatan.getSelectedItem().getValue()); lstHasil.getItems().clear(); int no = 1; for (final Perusahaan p : list) { Listitem item = new Listitem(); item.setValue(p); item.appendChild(new Listcell(p.getNamaPerusahaan())); item.appendChild(new Listcell(p.getNamaPimpinan())); item.appendChild( new Listcell( p.getAlamatJalan() + ", " + p.getKota() + " Telp: " + p.getTelp() + " Fax: " + p.getFax())); Toolbarbutton btnDetail = new Toolbarbutton(); btnDetail.setId("btnDetail" + (no++)); btnDetail.setImage("/img/detail.png"); btnDetail.setTooltiptext("Klik di sini untuk Detail dan Perubahan data"); btnDetail.addEventListener( "onClick", new EventListener() { public void onEvent(Event event) throws Exception { // panggil form edit Window win = (Window) Executions.createComponents("/zul/admin/editPerusahaan.zul", null, null); Textbox txtIdPerusahaan = (Textbox) win.getFellow("txtIdPerusahaan"); txtIdPerusahaan.setValue(p.getId()); win.doModal(); cari(); } }); Toolbarbutton btnHapus = new Toolbarbutton(); btnHapus.setId("btnHapus" + no++); btnHapus.setImage("/img/delete.png"); btnHapus.setTooltiptext("Klik untuk mengahapus Perusahaan"); btnHapus.addEventListener( "onClick", new EventListener() { public void onEvent(Event event) throws Exception { if (Messagebox.show( "Hapus?", "Konfirmasi", Messagebox.YES | Messagebox.NO, Messagebox.QUESTION) == Messagebox.YES) { Connection connDel = getConn(); try { PerusahaanDAO daoDel = new PerusahaanDAOImpl(connDel); daoDel.delete(p.getId()); cari(); } catch (Exception ex) { Messagebox.show(ex.getMessage()); } finally { connDel.close(); } } } }); Listcell cellAksi = new Listcell(); cellAksi.appendChild(btnDetail); cellAksi.appendChild(new Space()); cellAksi.appendChild(btnHapus); item.appendChild(cellAksi); lstHasil.appendChild(item); } } catch (Exception ex) { Messagebox.show(ex.getMessage()); } finally { conn.close(); } }