Ignore:
Timestamp:
06/10/13 01:07:16 (12 years ago)
Author:
hendrikvanantwerpen
Message:

Save answers, improved response page and question widgets.

  • Warn if _ComplexValueMixin is not pout on a form element, to prevent 'name' collisions. Changed all depending widgets to <form>'s.
  • Fixed names for question widgets to actually save answers.
  • Fixed and improved response page.
  • Fixed names in MultipleChoice? widget, which behaves different for radio and check.
File:
1 edited

Legend:

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

    r443 r461  
    33    "dijit/form/_FormMixin",
    44    "dojo/_base/array",
    5     "dojo/_base/declare"
    6 ], function(_Container, _FormMixin, array, declare) {
     5    "dojo/_base/declare",
     6    "dojo/_base/event"
     7], function(_Container, _FormMixin, array, declare, event) {
    78    return declare([_Container,_FormMixin],{
    89        name: "",
     
    1011        disabled: false,
    1112        readOnly: false,
     13        postCreate: function() {
     14            this.inherited(arguments);
     15            if ( this.domNode.tagName.toLowerCase() !== "form" ) {
     16                console.warn("Not scoping a _ComplexValueMixin in a form element can cause name clashes. E.g. radio buttons might stop working correctly. It is recommended to use <form> as the root element in your template for "+this.declaredClass+".");
     17            }
     18        },
    1219        _setDisabledAttr: function(value) {
    1320            this._set("disabled", value);
     
    2734                children[0].focus();
    2835            }
     36        },
     37        onSubmit: function(e) {
     38            // since this widget is used to create more complex
     39            // widgets within other forms, the onSubmit must either be
     40            // ignored or propagated, but not handled here.
     41            if ( e ) { event.stop(e); }
     42            return false;
     43        },
     44        _onSubmit: function(e) {
     45            // since this widget is used to create more complex
     46            // widgets within other forms, the onSubmit must either be
     47            // ignored or propagated, but not handled here.
     48            if ( e ) { event.stop(e); }
     49            return false;
    2950        }
    3051    });
Note: See TracChangeset for help on using the changeset viewer.