Changeset 372


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.

Location:
Dev/branches/rest-dojo-ui/client/rft
Files:
5 edited

Legend:

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

    r366 r372  
    88                </div>
    99                <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region:'left', design:'headline'" style="width: 300px;">
    10                        
    1110                        <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
    1211                                <div id="QuestionEditorToolkit"></div>
  • 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        });
  • Dev/branches/rest-dojo-ui/client/rft/ui/AccordionList.js

    r316 r372  
    1111            idProperty: null,
    1212            categoryProperty: null,
    13             titleProperty: null,
     13            titleProperty: "test",
    1414            actions: null,
    1515            _widgets: null,
  • Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js

    r366 r372  
    1414
    1515                        templateString: template,
     16                        question: null,
     17
    1618                        postCreate: function(){
    1719                                this.contentSource = new dojo.dnd.Source(this.ToolkitContentSourceNode, {
  • Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorToolkit.html

    r366 r372  
    22        <div data-dojo-type="dijit.layout.AccordionContainer" class="orange">
    33                <div data-dojo-type="dijit.layout.ContentPane" title="Properties" data-dojo-props="iconClass:'rftIcon rftIconProperties'">
    4                         <form id="propertiesForm">
     4            <div id="propertiesForm" data-dojo-type="dijit.form.Form" data-dojo-attach-point="propertiesForm" data-rft-attach-event="onSubmit:onSave">
    55                                <fieldset class="align">
    6                                         <label for="propertiesTitle">Title:</label><input data-dojo-type="dijit.form.TextBox" id="propertiesTitle"/>
    7                                         <label for="propertiesCode">Code:</label><input data-dojo-type="dijit.form.TextBox" id="propertiesCode"/>
    8                                         <label for="propertiesCategories">Categories:</label><input data-dojo-type="dijit.form.FilteringSelect" id="propertiesCategories"/>
    9                                         <label for="propertiesTopic">Topic:</label><input data-dojo-type="dijit.form.FilteringSelect" id="propertiesTopic"/>
    10                                         <label for="propertiesDescription">Description:</label><textarea data-dojo-type="dijit.form.Textarea" id="propertiesDescription"></textarea>
     6                                        <label for="propertiesTitle">Title:</label><input data-dojo-type="dijit.form.TextBox" id="propertiesTitle" name="title"/>
     7                                        <label for="propertiesCode">Code:</label><input data-dojo-type="dijit.form.TextBox" id="propertiesCode" name= "code"/>
     8                                        <label for="propertiesCategories">Categories:</label><input data-dojo-type="dijit.form.FilteringSelect" id="propertiesCategories" name="categories"/>
     9                                        <label for="propertiesTopic">Topic:</label><input data-dojo-type="dijit.form.FilteringSelect" id="propertiesTopic" name="topic"/>
     10                                        <label for="propertiesDescription">Description:</label><textarea data-dojo-type="dijit.form.Textarea" id="propertiesDescription" name="description"></textarea>
    1111                                </fieldset>
    12                         </form>
     12                        </div>
    1313                </div>
    1414
Note: See TracChangeset for help on using the changeset viewer.