0

How to make colspan in Listgroup on my custom ListitemRenderer?

asked 2009-12-17 11:06:30 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

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?

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-12-17 11:32:59 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

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);

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-12-17 11:06:30 +0800

Seen: 693 times

Last updated: Dec 17 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More