Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

qooxdoo - custom listitem widget selection -


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

i have problem selection items on list. there selected first element (no matter element on list click).

what should resolve problem?

here 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() {      }  }); 

... , here how 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);     } }); 

looks problem in binditem function. supply own binditem function, default bound properties not bound anymore. means lable, icon , model no longer in sync. havent tried code guess simple binding of model, problem gone.

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

this necessary in case want different in model property , that, in selection example. code line uses whole object model in cases idea.

best, martin


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -