-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I've a custom ListitemRenderer that I use to group some rows, this is my listbox:
<listbox id="list" multiple="true" checkmark="true"> <listhead> <listheader label="#" width="5%"/> <listheader label="Product" width="15%"/> <listheader label="Color" width="50%"/> <listheader label="Quantity" width="15%" align="right"/> <listheader label="Price" width="15%" align="right"/> </listhead> </listbox>
I want to show on the Listgroup two informations one is the product's name and the summarized quantity of all products that belongs to this group, this is what I tried:
public class PedidoVendaItemGroupRenderer implements ListitemRenderer { public void render(Listitem listitem, Object obj) throws Exception { PedidoVendaItem item = (PedidoVendaItem) obj; if (listitem instanceof Listgroup) { listitem.setValue(item.getProduto()); listitem.setCheckable(false); new Listcell(item.getName()).setParent(listitem); Listcell cellQuantidade = new Listcell(); cellQuantidade.setParent(listitem); new NumberLabel(summarizedQuantity).setParent(cellQuantidade); } else { // normal rows here, nothing special in this code
Now I need to make the first Listcell span throgh the first 3 columns, I've tried to setRowSpan on Listcell but this method doesn't exists. How could I do this?
I've found what I need in the API, just use setSpan:
listitem.setValue(item.getProduto()); listitem.setCheckable(false); Listcell cellProduto = new Listcell(sb.toString()); cellProduto.setParent(listitem); cellProduto.setSpan(3);
Asked: 2009-12-17 11:06:30 +0800
Seen: 693 times
Last updated: Dec 17 '09