Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3617294
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:36:22+00:00 2026-05-18T22:36:22+00:00

I made custom listitem view (based on http://news.qooxdoo.org/tutorial-part-4-2-custom-widgets-4 ). I have problem with selection

  • 0

I made custom listitem view (based on http://news.qooxdoo.org/tutorial-part-4-2-custom-widgets-4).

I have problem with selection items on this list. There is always selected first element (no matter which element on list I will click).

What should I do to resolve my problem?

Here is my list-item widget:

qx.Class.define("project.MyView", {
    extend : qx.ui.core.Widget,
    include : [qx.ui.form.MModelProperty],

    construct : function() {
        this.base(arguments);

        var layout = new qx.ui.layout.Grid(4, 2);
        layout.setColumnFlex(1, 1);
        this._setLayout(layout);

        this._createChildControl("icon");
        this._createChildControl("date");
        this._createChildControl("description");
    },

    properties : {
        appearance : {
            refine : true,
            init : "listitem"
        },

        icon : {
            check : "String",
            apply : "_applyIcon",
            nullable : true
        },

        date : {
            check : "String",
            apply : "_applyDate",
            nullable : true
        },

        description : {
            check : "String",
            apply : "_applyDescription",
            nullable : true
        }
    },

    members : {

        _createChildControlImpl : function(id) {
            var control;

            switch (id) {
            case "icon":
                control = new qx.ui.basic.Image(this.getIcon());
                control.setAnonymous(true);
                this._add(control, {
                    row : 0,
                    column : 0,
                    rowSpan : 2
                });
                break;

            case "date":
                control = new qx.ui.basic.Label(this.getDate());
                control.setAnonymous(true);
                this._add(control, {
                    row : 0,
                    column : 2
                });
                break;

            case "description":
                control = new qx.ui.basic.Label(this.getDescription());
                control.setAnonymous(true);
                control.setRich(true);
                this._add(control, {
                    row : 0,
                    column : 1
                });
                break;
            }

            return control || this.base(arguments, id);
        },

        _applyIcon : function(value, old) {
            var icon = this.getChildControl("icon");
            icon.setSource(value);
        },

        _applyDescription : function(value, old) {
            var description = this.getChildControl("description");
            description.setValue(value);
        },

        _applyDate : function(value, old) {
            var date = this.getChildControl("date");
            date.setValue(value);
        }

    },

    destruct : function() {

    }

});

… and here how I use it:

this.list = new qx.ui.form.List();
this.listController = new qx.data.controller.List(null, this.list);
this.listController.setDelegate({
    createItem : function() {
        return new project.MyView();
    },

    bindItem : function(controller, item, id) {
        controller.bindProperty("description", "description", null,item, id);
        controller.bindProperty("icon", "icon", null, item, id);
        controller.bindProperty("date", "date", null, item, id);
    },

    configureItem : function(item) {
        item.getChildControl("icon").setWidth(48);
        item.getChildControl("icon").setHeight(48);
        item.getChildControl("icon").setScale(true);
        item.setMinHeight(52);
    }
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:36:22+00:00Added an answer on May 18, 2026 at 10:36 pm

    looks like the Problem is in the bindItem function. As soon as you supply your own bindItem function, all default bound properties are not bound anymore. That means that lable, icon and model are no longer in sync. I havent tried you code but i guess with a simple binding of the model, the problem will be gone.

    controller.bindProperty("", "model", null, item, id);
    

    This is necessary in case you want something different in your model property and with that, in your selection for example. This code line just uses the whole object as model which is in the most cases a good idea.

    Best,
    Martin

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a custom listview following the tutorial in this link http://www.coderzheaven.com/2012/03/23/how-to-create-a-custom-listbox-in-windows-phone-7/ and My
I made a custom handler that derives from MvcHandler. I have my routes using
I have made a custom formwizard and incorporated it into my admin interface. Basically
I have made custom .xml layout for ListView. Now it looks: But it isn't
i made a custom view which should animate a dot on a background according
I made a custom ButtonField class where I have an image as a button.
I have made custom xhtml valdidator in .NET(validating through dtd + some extra rules)
I have made custom login control for DNN (DotNetNuke). Now I am trying to
For MS CRM 2011 I have made custom workflow activity, but I'm not able
I made a custom http server using java. It runs properly on XP machines

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.