@Listen("onSeleccion = #divCatalogoInforme") public void seleccion() { Informe informe = catalogo.objetoSeleccionadoDelCatalogo(); ltbAcciones.getItems().clear(); List<PlanAccion> planes = servicioPlanAccion.buscarPorInformeyTipo(informe, "normal"); if (!planes.isEmpty()) { ltbAcciones.setModel(new ListModelList<PlanAccion>(planes)); ltbAcciones.setCheckmark(false); ltbAcciones.setMultiple(false); ltbAcciones.setCheckmark(true); ltbAcciones.setMultiple(true); ltbAcciones.renderAll(); if (ltbAcciones.getItemCount() != 0) { for (int i = 0; i < ltbAcciones.getItemCount(); i++) { Listitem listItem = ltbAcciones.getItemAtIndex(i); PlanAccion plan = listItem.getValue(); if (plan.getEstado().equals("Finalizado")) listItem.setSelected(true); else listItem.setSelected(false); } } } ltbAccionesInspector.getItems().clear(); List<PlanAccion> planes2 = servicioPlanAccion.buscarPorInformeyTipo(informe, "inspector"); if (!planes.isEmpty()) { ltbAccionesInspector.setModel(new ListModelList<PlanAccion>(planes2)); ltbAccionesInspector.setCheckmark(false); ltbAccionesInspector.setMultiple(false); ltbAccionesInspector.setCheckmark(true); ltbAccionesInspector.setMultiple(true); ltbAccionesInspector.renderAll(); if (ltbAccionesInspector.getItemCount() != 0) { for (int i = 0; i < ltbAccionesInspector.getItemCount(); i++) { Listitem listItem = ltbAccionesInspector.getItemAtIndex(i); PlanAccion plan = listItem.getValue(); if (plan.getEstado().equals("Finalizado")) listItem.setSelected(true); else listItem.setSelected(false); } } } lblOrdenamientos.setValue(informe.getOrdenamientos()); lblFuncionario.setValue(informe.getFuncionario()); if (informe.getFechaVisita() != null) lblFechaVisita.setValue(formatoFecha.format(informe.getFechaVisita())); lblCodigo.setValue(informe.getCodigo()); lblCedula.setValue(informe.getPacienteA().getCedula()); lblFicha.setValue(informe.getPacienteA().getFicha()); lblNombre.setValue( informe.getPacienteA().getPrimerNombre() + " " + informe.getPacienteA().getPrimerApellido()); lblDescripcion.setValue(informe.getFgad()); lblTipo.setValue(informe.getFga()); dtbFecha.setValue(informe.getFa()); codigoInforme = informe.getIdInforme(); catalogo.setParent(null); }
public void limpiarCampos() { TabConfigur configuracion = servicioConfiguracion.buscar(1); TabEmpresa empresa = servicioEmpresa.buscar(configuracion.getIdEmp()); txtNumero.setValue(0); idEmpresa = empresa.getIDEmp(); lblNombre.setValue(empresa.getNomEmp()); lblDireccion.setValue(empresa.getDirEmp()); lblFax.setValue(empresa.getFaxEmp()); lblNit.setValue(empresa.getNitEmp()); lblRif.setValue(empresa.getRifEmp()); lblTelefono.setValue(empresa.getTelEmp()); lblElaborado.setValue(nombreUsuarioSesion()); lblAutorizado.setValue(configuracion.getAutoriza()); lblRevisado.setValue(configuracion.getRevisa()); clave = null; txtTotal.setValue(null); txtNumero.setValue(null); txtProveedor.setValue(null); lblProveedor.setValue(""); buscadorClase.settearCampo(null); buscadorMoneda.settearCampo(null); buscadorTipo.settearCampo(null); listaDetalle.clear(); ltbPedidos.getItems().clear(); limpiarCamposItem(); }
public void onClick$voltarPaginaListaFrequencia(Event e) { for (Intbox i : intbox) { i.setId(null); i.setVisible(false); } for (Row r : rowss) { r.setId(null); r.setVisible(false); } rowss.clear(); rowss = new ArrayList<Row>(); intbox.clear(); intbox = new ArrayList<Intbox>(); ListagemDisciplina.setSelectedItem(null); ListagemAluno.getItems().clear(); janelaDisciplinaAluno.setVisible(false); JanelaFiltroParaListarDisciplina.setVisible(true); binder.loadComponent(indexFrequencia); }
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.."); } }
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()); } }
// 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); } }
@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); } }); }
@SuppressWarnings("unchecked") public void removeObjeto(T objeto) { List<Listitem> itens = lbDisponiveis.getItems(); for (Listitem listitem : itens) { if (objeto.equals(listitem.getValue())) { lbDisponiveis.removeChild(listitem); return; } } itens = lbSelecionados.getItems(); for (Listitem listitem : itens) { if (objeto.equals(listitem.getValue())) { lbSelecionados.removeChild(listitem); return; } } }
public void renderizarMapaDatos() { listboxProcedimientos.getItems().clear(); for (Long key_map : mapa_datos_procedimientos.keySet()) { Map<String, Object> pcd = (Map<String, Object>) mapa_datos_procedimientos.get(key_map); adicionarProcedimiento(pcd); } listboxProcedimientos.invalidate(); }
@SuppressWarnings({"unchecked", "rawtypes"}) public Set<T> getSelecionados() { Collection<Listitem> selecionados = lbSelecionados.getItems(); Set<T> selec = new HashSet(); for (Listitem item : selecionados) { selec.add((T) item.getValue()); } return selec; }
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); } } }
protected boolean validar() { if (!camposLLenos()) { msj.mensajeError(Mensaje.camposVacios); return false; } else { if (ltbPedidos.getItems().isEmpty()) { msj.mensajeError("Debe agregar al menos un item a los detalles"); return false; } return true; } }
/* * 刷新topNList */ private void refreshiControl() { ChartUtil.clearListbox(topNList); TopNListitemModel model = new TopNListitemModel(topNReport); // ChartUtil.makelistData(topNList, model, model); try { for (TopNBean m : model.getTopNData()) { Image image = null; if (m.getDeny().equals("允许")) { image = new Image("/main/images/button/ico/enable_bt.gif"); } else { image = new Image("/main/images/button/ico/disable_bt.gif"); } Listitem item = ChartUtil.addRow( topNList, m, m.getTitle(), m.getDescript(), m.getPeriod(), new Image("/main/images/filetype/" + m.getFiletype() + ".gif"), image, m.getEditImage()); item.setId(m.getSection()); item.addForward("onClick", topNReport, "onSelecttopNList"); } } catch (Exception e) { e.printStackTrace(); } String section = (String) Executions.getCurrent().getDesktop().getSession().getAttribute("topNReportlit_id"); if (null == section) return; Listitem selectedItem = null; for (Object obj : topNList.getItems()) { if (obj instanceof Listitem) { Listitem tmpItem = (Listitem) obj; if (tmpItem.getId().equals(section)) { selectedItem = tmpItem; } } } if (null != selectedItem) { selectedItem.setSelected(true); Events.sendEvent(new Event(Events.ON_SELECT, topNList)); topNList.setActivePage(selectedItem); } }
public void onClick$submit() { ulist.clear(); Object[] items = listbox2.getItems().toArray(); for (int i = 0; i < items.length; i++) { Listitem item = (Listitem) items[i]; ulist.add((WkTUser) item.getValue()); } if (type == 0) { voteList.addAll(ulist); } else { voterList.addAll(ulist); } Events.postEvent(Events.ON_CHANGE, this, null); }
public void verificarSeleccion() { List<Listitem> listado_items = listboxProcedimientos.getItems(); if (!listado_items.isEmpty()) { boolean todos = true; for (Listitem listitem : listado_items) { if (!listitem.isSelected()) { todos = false; break; } } checkboxSeleccionar_todos.setChecked(todos); } else { checkboxSeleccionar_todos.setChecked(false); } }
// Metodo para colocar los datos del objeto que se consulta en la vista // public void mostrarDatos(Object obj) throws Exception { Maestro_manual maestro_manual = (Maestro_manual) obj; try { procedimientos_seleccionados.clear(); mapa_datos_procedimientos.clear(); lgxId_manual.setValue(maestro_manual.getId_manual()); tbxManual.setValue(maestro_manual.getManual()); Utilidades.seleccionarListitem(lbxTipo_manual, maestro_manual.getTipo_manual()); Utilidades.seleccionarListitem(lbxTipo_moneda, maestro_manual.getTipo_moneda()); listboxProcedimientos.getItems().clear(); Map<String, Object> parametros = new HashMap<String, Object>(); parametros.put("id_manual", maestro_manual.getId_manual()); List<Manuales_procedimientos> listado_procedimientos = getServiceLocator().getServicio(Manuales_procedimientosService.class).listar(parametros); for (Manuales_procedimientos manuales_procedimientos : listado_procedimientos) { Long id_procedimiento = manuales_procedimientos.getId_procedimiento(); Procedimientos procedimientos = new Procedimientos(); procedimientos.setId_procedimiento(id_procedimiento); procedimientos = getServiceLocator().getProcedimientosService().consultar(procedimientos); Map<String, Object> pcd = OpenProcedimientosAction.getProcedimientoMap( codigo_empresa, codigo_sucursal, procedimientos); mapa_datos_procedimientos.put(id_procedimiento, pcd); pcd.put("codigo_manual", manuales_procedimientos.getCodigo_manual()); pcd.put("valor", manuales_procedimientos.getValor()); pcd.put("grupo_uvr", manuales_procedimientos.getGrupo_uvr()); pcd.put( "nro_cuenta", manuales_procedimientos.getNro_cuenta_contable() != null ? manuales_procedimientos.getNro_cuenta_contable() : ""); adicionarProcedimiento(pcd); procedimientos_seleccionados.add(id_procedimiento + ""); } // Mostramos la vista // tbxAccion.setText("modificar"); accionForm(true, tbxAccion.getText()); } catch (Exception e) { MensajesUtil.mensajeError(e, "", this); } }
/** * 报告列表点击事件,显示自动生成的TOPN报告 * * @param event */ public void onSelecttopNList(Event event) { Listitem item = topNList.getSelectedItem(); if (topNGenerateTime.getItemCount() > 0) { topNGenerateTime.getItems().clear(); } if (item == null) { return; } String reportid = item.getId(); IniFile iniGen = new IniFile("reportTopN." + reportid + ".ini"); try { iniGen.load(); } catch (Exception e) { return; } topn_time.setVisible(true); TopNLogListmodel model = new TopNLogListmodel(iniGen, this); topNGenerateTime.setModel(model); topNGenerateTime.setItemRenderer(model); }
public void buscarProcedimientos() { String parametro = bandboxBusqueda.getValue().trim(); if (!parametro.isEmpty()) { List<Listitem> listado_items = listboxProcedimientos.getItems(); if (parametro.toUpperCase().equals(parametro_current)) { index_current++; if (index_current >= listado_resultados.size()) { index_current = 0; } } else { parametro_current = parametro.toUpperCase(); listado_resultados.clear(); for (int i = 0; i < listado_items.size(); i++) { Listitem listitem = listado_items.get(i); Map<String, Object> pcd = (Map<String, Object>) listitem.getValue(); String codigo_cups = (String) pcd.get("codigo_cups"); String nombre_procedimiento = (String) pcd.get("nombre_procedimiento"); if (codigo_cups.toUpperCase().contains(parametro.toUpperCase()) || nombre_procedimiento.toUpperCase().contains(parametro.toUpperCase())) { listado_resultados.add(i); } } if (!listado_resultados.isEmpty()) { index_current = 0; } else { index_current = -1; } } if (index_current != -1) { Listitem listitem = listado_items.get(listado_resultados.get(index_current)); listboxProcedimientos.setActivePage(listitem); Clients.scrollIntoView(listitem); MensajesUtil.notificarInformacion("Resultado encontrado", listitem); } else { MensajesUtil.notificarAlerta("No se encontraron resultado", bandboxBusqueda); } } }
/** * Retrieves the children available at the client within the given range. * * @param itemOnly whether to return only {@link Listitem} and derives. * @since 5.0.10 */ protected Set<? extends Component> getAvailableAtClient(int offset, int limit, boolean itemOnly) { if (!isCropper()) return null; final Set<Component> avail = new LinkedHashSet<Component>(32); if (!itemOnly) { avail.addAll(_listbox.getHeads()); final Listfoot listfoot = _listbox.getListfoot(); if (listfoot != null) avail.add(listfoot); final Paging paging = _listbox.getPagingChild(); if (paging != null) avail.add(paging); final Frozen frozen = _listbox.getFrozen(); if (frozen != null) avail.add(frozen); } int pgsz = limit; int ofs = offset; if (_listbox.getItemCount() > 0) { Component item = _listbox.getItems().get(0); while (item != null) { if (pgsz == 0) break; if (item.isVisible() && item instanceof Listitem) { if (--ofs < 0) { --pgsz; avail.add(item); } } if (item instanceof Listgroup) { final Listgroup g = (Listgroup) item; if (!g.isOpen()) { for (int j = 0, len = g.getItemCount(); j < len; j++) item = (Listitem) item.getNextSibling(); } } if (item != null) item = item.getNextSibling(); } } return avail; }
public void seleccionarTodos() { List<Listitem> listado_items = listboxProcedimientos.getItems(); for (Listitem listitem : listado_items) { listitem.setSelected(checkboxSeleccionar_todos.isChecked()); } }
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(); } }