define [ "dijit/_Container", "dijit/form/_FormMixin", "dojo/_base/array", "dojo/_base/declare", "dojo/_base/event" ], (_Container, _FormMixin, array, declare, event) -> declare [_Container,_FormMixin], name: "" value: null disabled: false readOnly: false postCreate: () -> @inherited arguments if @domNode.tagName.toLowerCase() isnt "form" 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
as the root element in your template for", @declaredClass _setDisabledAttr: (value) -> @_set "disabled", value array.forEach @_getDescendantFormWidgets(), (child) => child.set "disabled", value _setReadOnlyAttr: (value) -> @_set "readOnly", value array.forEach @_getDescendantFormWidgets(), (child) => child.set "readOnly", value focus: () -> children = @_getDescendantFormWidgets() children[0].focus() if children.length > 0 onSubmit: (e) => # since this widget is used to create more complex # widgets within other forms, the onSubmit must either be # ignored or propagated, but not handled here. event.stop e if e false _onSubmit: (e) => # since this widget is used to create more complex # widgets within other forms, the onSubmit must either be # ignored or propagated, but not handled here. event.stop if e false