Hello Qooxdooers;

I have just started hacking around with qooxdoo, and am very
impressed.  I have however encountered a problem.  I am creating a
list of checkboxes which are bound to objects, so that when the user
[un]checks one of the list items, this makes a change to the
corresponding object, and fires the corresponding change event.  I
have followed the code in the data/ExtendedList demo, and it runs
without errors; however, when a list item is clicked, the value in the
corresponding object is not changed, and the event in the object is
not fired.

I have included the source files for the application and the list
object type; I would much appreciate any help.

Thanks and regards,

Will


/*** listtest/Application.js ***/

qx.Class.define("listtest.Application", {
        extend : qx.application.Standalone,

        members : {
                data: null,
                main : function() {
                        this.base(arguments);

                        if (qx.core.Variant.isSet("qx.debug", "on")) {
                                qx.log.appender.Console;
                        }

                        var root = this.getRoot();
                        var list = new qx.ui.form.List();
                        list.setWidth(100);

                        var controller = new qx.data.controller.List(null, 
list);
                        var app = this;
                        controller.setDelegate({
                                createItem: function() {
                                        return new qx.ui.form.CheckBox();
                                },
                                bindItem: function(controller, item, id) {
                                        controller.bindProperty("name", 
"label", null, item, id);
                                        controller.bindProperty("chosen", 
"checked", null, item, id);
                                }
                        });

                        this.data = new qx.data.Array();
                        this.data.push(new listtest.MyBean("bean 1"));
                        this.data.push(new listtest.MyBean("bean 2"));
                        controller.setModel(this.data);
                        root.add(list, {top: 10, left: 10});

                }
        }
});


/*** listtest/MyBean.js ***/

qx.Class.define("listtest.MyBean", {
        extend: qx.core.Object,
        construct: function(name) {
                this.setName(name);
        },
        members: {
                applyChosen: function(val) {
                        alert("changed! "+val);
                }
        },
        properties: {
                name: {
                        check: "String",
                        event: "changeName",
                        nullable: true
                },
                chosen: {
                        check: "Boolean",
                        event: "changeChosen",
                        init: false,
                        nullable: false,
                        apply: "applyChosen"
                }
        }
});

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to