Ignore:
Timestamp:
03/13/14 22:21:55 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Another shot at getting change events right for _ComplexValueMixin. Our previous approach made it impossible to detect if a change was cause during startup. Now we work purely with widget 'change' events. Children are connected during postCreate, addChild. If you add children otherwise you need to call connectChildsChanges yourself. Also to make sure events are generated, use _setValueInternal if you really need to set the value attribute yourself.
  • Removed unused widget.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/widgets/ObjectBox.js

    r510 r513  
    22    "../lib/object",
    33    "./LineWithActionsWidget",
     4    "./_ComplexValueWidget",
    45    "dijit/_TemplatedMixin",
    56    "dijit/_WidgetBase",
     
    89    "dojo/_base/lang",
    910    "dojo/text!./templates/ObjectBox.html"
    10 ], function(objectFuns, LineWithActionsWidget, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, declare, lang, template) {
    11     return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
     11], function(objectFuns, LineWithActionsWidget, _ComplexValueWidget, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, declare, lang, template) {
     12    return declare([_ComplexValueWidget], {
    1213        baseClass: "rftObjectBox",
    1314        templateString: template,
    14         value: null,
    1515        actions: null,
    1616        startup: function() {
     
    5454        },
    5555        _showInfoBox: function() {},
    56         _setValueAttr: function(value) {
    57             this.value = value;
    58             this._refresh();
    59         },
    60         _getValueAttr: function(value) {
    61             this.value = value;
    62         },
    63         _refresh: function() {
    64             if ( this.value !== null ) {
    65                 this.iconNode.className = "rftIcon typeIcon rftIcon"+(this.value.type || '');
    66                 this.line1.set('title', this.value.title || '');
    67                 this.line2.set('title', this.value.subTitle || '');
    68                 this.line3.set('title', this.value.lowerTitle || '');
     56        onChange: function(value) {
     57            if ( value ) {
     58                this.iconNode.className = "rftIcon typeIcon rftIcon"+(value.type || '');
     59                this.line1.set('title', value.title || '');
     60                this.line2.set('title', value.subTitle || '');
     61                this.line3.set('title', value.lowerTitle || '');
    6962            }
    7063        }
Note: See TracChangeset for help on using the changeset viewer.