0

How to get the value of various doubleboxes inside a grid?

asked 2009-06-12 13:24:11 +0800

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

Hi all,

I've build a grid that shows a list of possible items to add in a order and in front of each item is a doublebox which corresponds to the quantity of that item, I'd like to let the user choose all the quantities of all items he wants and when he click on Add All button I get the quantity values to update the model's list item.

The zul:

        <grid id="grdCores" fixedLayout="true" mold="paging" pageSize="7">
            <columns>
                <column label="Item Name" width="55px"/>
                <column label="Quantity" width="90px"/>
            </columns>
        </grid>

The composer:

    public static final grdCoresRowRenderer = new GridAddCoresRowRenderer();
    public void afterCompose() {
        grdCores.setRowRenderer(grdCoresRowRenderer)    
    }
    public void onClick_btnCarregarEstoque(Event event) {
       // get the data from database
        grdCores.setModel(new SimpleListModel(list))
    }

And the renderer:

public class GridAddCoresRowRenderer implements RowRenderer {
    public void render(Row row, Object estoque) throws Exception {
        new Label(estoque.toString).setParent(row);
        new Doublebox(0).setParent(row);
    }
}

How could I get the data that user enter for each item?

Regards,
Felipe Cypriano

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-06-15 12:34:02 +0800

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

I found that I can annotate a manually created component doing this:

Listbox listbox = new Listbox();
listbox.addAnnotation("some", null);

How could I use it to do data binding? Is it possible?

IMO, this ZK Annotation page is a little confuse I couldn't understand how and why use annotations (I know that data binding use annotations in zul file just it).

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-06-12 13:24:11 +0800

Seen: 388 times

Last updated: Jun 15 '09

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