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;
|
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.Listcell;
|
||||||
import org.zkoss.zul.Listitem;
|
import org.zkoss.zul.Listitem;
|
||||||
import org.zkoss.zul.ListitemRenderer;
|
import org.zkoss.zul.ListitemRenderer;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
|
@ -25,7 +30,27 @@ public class RenderCategoriaSimple implements ListitemRenderer {
|
||||||
|
|
||||||
lc = new Listcell(categoria.getDesccategoria());
|
lc = new Listcell(categoria.getDesccategoria());
|
||||||
lc.setParent(lstm);
|
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);
|
lstm.setAttribute("data", categoria);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue