git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@29484 d1611594-4594-4d17-8e1d-87c2c4800839
parent
8b2e79de6c
commit
3d831d34e1
|
@ -4,11 +4,16 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
||||
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.Categoria;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
|
@ -26,6 +31,26 @@ public class RenderCategoriaSimple implements ListitemRenderer {
|
|||
lc = new Listcell(categoria.getDesccategoria());
|
||||
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((Categoria) listItem.getAttribute("data"));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
lc.appendChild(btn);
|
||||
lstm.setAttribute("data", categoria);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue