@Listen("onClick = #btnBuscarF0004, #btnBuscarF0004Filtro") public void mostrarCatalogoF0004(Event evento) { Button boton = (Button) evento.getTarget(); idBoton = boton.getId(); final List<F0004> listF0004 = servicioF0004.buscarTodosOrdenados(); catalogoF0004 = new CatalogoGenerico<F0004>( divCatalogoF0004, "Catalogo de Codigos Definidos por el Usuario", listF0004, true, false, false, "SY", "RT", "Descripcion", "Codigo", "2 Linea", "Numerico") { @Override protected List<F0004> buscar(List<String> valores) { List<F0004> lista = new ArrayList<F0004>(); for (F0004 f0004 : listF0004) { if (f0004.getId().getDtsy().toLowerCase().contains(valores.get(0).toLowerCase()) && f0004.getId().getDtrt().toLowerCase().contains(valores.get(1).toLowerCase()) && f0004.getDtdl01().toLowerCase().contains(valores.get(2).toLowerCase()) && String.valueOf(f0004.getDtcdl()) .toLowerCase() .contains(valores.get(3).toLowerCase()) && f0004.getDtln2().toLowerCase().contains(valores.get(4).toLowerCase()) && f0004.getDtcnum().toLowerCase().contains(valores.get(5).toLowerCase())) { lista.add(f0004); } } return lista; } @Override protected String[] crearRegistros(F0004 f0004) { String[] registros = new String[6]; registros[0] = f0004.getId().getDtsy(); registros[1] = f0004.getId().getDtrt(); registros[2] = f0004.getDtdl01(); if (f0004.getDtcdl() != null) registros[3] = String.valueOf(f0004.getDtcdl()); else registros[3] = null; registros[4] = f0004.getDtln2(); registros[5] = f0004.getDtcnum(); return registros; } }; catalogoF0004.setClosable(true); catalogoF0004.setWidth("80%"); catalogoF0004.setParent(divCatalogoF0004); catalogoF0004.doModal(); }
public void mostrarCatalogo() { listaGeneral = new ArrayList<F0005>(); // if (sy.equals("") && rt.equals("")) listaGeneral = servicioF0005.buscarTodosOrdenados(); // else // listF0005New = servicioF0005.buscarParaUDCOrdenados(sy, rt); final List<F0005> listF0005 = listaGeneral; catalogo = new CatalogoGenerico<F0005>( catalogoF0005, "F0005", listF0005, false, false, false, "SY", "RT", "KY", "Descripcion 01", "Descripcion 02", "Gestion Especial", "Codificacion Fija") { @Override protected List<F0005> buscar(List<String> valores) { List<F0005> listF0005_2 = new ArrayList<F0005>(); for (F0005 f0005 : listF0005) { if (f0005.getId().getDrsy().toLowerCase().contains(valores.get(0).toLowerCase()) && f0005.getId().getDrrt().toLowerCase().contains(valores.get(1).toLowerCase()) && f0005.getId().getDrky().toLowerCase().contains(valores.get(2).toLowerCase()) && f0005.getDrdl01().toLowerCase().contains(valores.get(3).toLowerCase()) && f0005.getDrdl02().toLowerCase().contains(valores.get(4).toLowerCase()) && f0005.getDrsphd().toLowerCase().contains(valores.get(5).toLowerCase()) && f0005.getDrhrdc().toLowerCase().contains(valores.get(6).toLowerCase())) { listF0005_2.add(f0005); } } return listF0005_2; } @Override protected String[] crearRegistros(F0005 f0005) { String[] registros = new String[7]; registros[0] = f0005.getId().getDrsy(); registros[1] = f0005.getId().getDrrt(); registros[2] = f0005.getId().getDrky(); registros[3] = f0005.getDrdl01(); registros[4] = f0005.getDrdl02(); registros[5] = f0005.getDrsphd(); registros[6] = f0005.getDrhrdc(); return registros; } }; catalogo.setParent(catalogoF0005); }
@Listen("onSeleccion = #divCatalogoF0004") public void seleccion() { F0004 f0004 = catalogoF0004.objetoSeleccionadoDelCatalogo(); switch (idBoton) { case "btnBuscarF0004": txtSYF0005.setValue(f0004.getId().getDtsy()); txtRTF0005.setValue(f0004.getId().getDtrt()); lblDescripcionF0004.setValue( servicioF0004.buscar(f0004.getId().getDtsy(), f0004.getId().getDtrt()).getDtdl01()); break; case "btnBuscarF0004Filtro": lblSY.setValue(f0004.getId().getDtsy()); lblRT.setValue(f0004.getId().getDtrt()); lblF0004.setValue(f0004.getDtdl01()); catalogo.actualizarLista( servicioF0005.buscarParaUDCOrdenados(f0004.getId().getDtsy(), f0004.getId().getDtrt())); break; default: break; } catalogoF0004.setParent(null); }