fixes bug#AL-4193

master
Gleison da Cruz 2024-04-22 12:10:26 -03:00
parent 35fb506d74
commit e76d909b2e
4 changed files with 68 additions and 10 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId>
<version>1.65.0</version>
<version>1.65.1</version>
<packaging>war</packaging>
<properties>

View File

@ -45,7 +45,7 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCorridaOrigemDestino;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioLinhaHorario;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioLinhaHorarioRuta;
@Controller("relatorioLinhasHorarioController")
@Scope("prototype")
@ -276,8 +276,8 @@ public class RelatorioLinhasHorarioController extends MyGenericForwardComposer {
lsGrupoRuta = grupoRutaService.obtenerTodos();
linhaList.setItemRenderer(new RenderRelatorioLinhaHorario());
linhaListSelList.setItemRenderer(new RenderRelatorioLinhaHorario());
linhaList.setItemRenderer(new RenderRelatorioLinhaHorarioRuta());
linhaListSelList.setItemRenderer(new RenderRelatorioLinhaHorarioRuta());
servicoList.setItemRenderer(new RenderCorridaOrigemDestino());
servicoListSelList.setItemRenderer(new RenderCorridaOrigemDestino());

View File

@ -33,12 +33,6 @@ public class RenderRelatorioLinhaHorario implements ListitemRenderer {
}
lc.setParent(lstm);
lc = new Listcell(ruta.getRutaId().toString());
lc.setParent(lstm);
lc = new Listcell(ruta.getIndSentidoIda() == true ? "IDA" : "VOLTA" );
lc.setParent(lstm);
Button btn = new Button();
lc = new Listcell();

View File

@ -0,0 +1,64 @@
package com.rjconsultores.ventaboletos.web.utilerias.render;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zul.Button;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.Ruta;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
public class RenderRelatorioLinhaHorarioRuta implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
Ruta ruta = (Ruta) o;
String num = ruta.getNumRuta()==null?"":ruta.getNumRuta();
Listcell lc = new Listcell(num);
lc.setParent(lstm);
lc = new Listcell(ruta.getPrefixo());
lc.setParent(lstm);
lc = new Listcell(ruta.getDescruta());
lc.setParent(lstm);
OrgaoConcedente orgaoConcedente = ruta.getOrgaoConcedente();
if (orgaoConcedente != null) {
lc = new Listcell(orgaoConcedente.getDescOrgao());
} else {
lc = new Listcell("-");
}
lc.setParent(lstm);
lc = new Listcell(ruta.getRutaId().toString());
lc.setParent(lstm);
lc = new Listcell(ruta.getIndSentidoIda() == true ? "IDA" : "VOLTA" );
lc.setParent(lstm);
Button btn = new Button();
lc = new Listcell();
lc.setParent(lstm);
btn.setWidth("16");
btn.setHeight("16");
btn.setImage("/gui/img/remove.png");
btn.addEventListener("onClick", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
MyListbox listBox = (MyListbox) event.getTarget().getParent().getParent().getParent();
Listitem listItem = (Listitem) event.getTarget().getParent().getParent();
listBox.removeItem((Ruta) listItem.getAttribute("data"));
}
});
lc.appendChild(btn);
lstm.setAttribute("data", ruta);
}
}