Ignore:
Timestamp:
07/23/12 17:03:47 (13 years ago)
Author:
jkraaijeveld
Message:

Started work on loading questions into the question editor if the already exist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/rest-dojo-ui/client/rft/pages/question.js

    r366 r372  
    1616    function(declare, lang, Deferred, LineWithActionsWidget, store, _Page, api, content, registry, on, behavior, query){
    1717        return declare('rft.pages.question', [_Page], {
    18             object: null,
    19             preview: null,
     18            question: null,
     19            _toolkit: null,
     20            _preview: null,
    2021           
    2122            onVisit: function() {
     
    2324                    Deferred.when(store.get(this.pageArgs.uid))
    2425                    .then(lang.hitch(this, function(obj) {
    25                         this.object = obj;
     26                        this.question = obj;
     27                        this._refresh();
    2628                    }));
    2729                } else {
    2830                    throw new Error("Error: no reference to object set!");
    2931                }
    30 
     32                this._setupEditor();
    3133                this._setupButtons();
    32                 this._setupEditor();
    3334            },
    3435            onLeave: function() {
    3536                this.inherited(arguments);
     37            },
     38            _refresh: function () {
     39                this._toolkit.propertiesForm.set('value', this.question);
    3640            },
    3741            _setupButtons: function() {
     
    5256            },
    5357            _setupEditor: function() {
    54                 this.toolkit = new rft.ui.QuestionEditorToolkit();
    55                 this.toolkit.placeAt("QuestionEditorToolkit");
     58//                this.toolkit = new rft.ui.QuestionEditorToolkit( { question: this.question } );
     59                this._toolkit = new rft.ui.QuestionEditorToolkit();
     60                this._toolkit.placeAt("QuestionEditorToolkit");
    5661
    57                 this.preview = new rft.ui.QuestionEditorPreview();
    58                 this.preview.placeAt("QuestionEditorPreview");
     62                this._preview = new rft.ui.QuestionEditorPreview();
     63                this._preview.placeAt("QuestionEditorPreview");
    5964            }
    6065        });
Note: See TracChangeset for help on using the changeset viewer.