TextBox.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. define("dojox/mobile/TextBox", [
  2. "dojo/_base/declare",
  3. "dojo/dom-construct",
  4. "dijit/_WidgetBase",
  5. "dijit/form/_FormValueMixin",
  6. "dijit/form/_TextBoxMixin"
  7. ], function(declare, domConstruct, WidgetBase, FormValueMixin, TextBoxMixin){
  8. /*=====
  9. WidgetBase = dijit._WidgetBase;
  10. FormValueMixin = dijit.form._FormValueMixin;
  11. TextBoxMixin = dijit.form._TextBoxMixin;
  12. =====*/
  13. return declare("dojox.mobile.TextBox",[WidgetBase, FormValueMixin, TextBoxMixin],{
  14. // summary:
  15. // A non-templated base class for textbox form inputs
  16. baseClass: "mblTextBox",
  17. // Override automatic assigning type --> node, it causes exception on IE8.
  18. // Instead, type must be specified as this.type when the node is created, as part of the original DOM
  19. _setTypeAttr: null,
  20. // Map widget attributes to DOMNode attributes.
  21. _setPlaceHolderAttr: "textbox",
  22. buildRendering: function(){
  23. if(!this.srcNodeRef){
  24. this.srcNodeRef = domConstruct.create("input", {"type":this.type});
  25. }
  26. this.inherited(arguments);
  27. this.textbox = this.focusNode = this.domNode;
  28. },
  29. postCreate: function(){
  30. this.inherited(arguments);
  31. this.connect(this.textbox, "onfocus", "_onFocus");
  32. this.connect(this.textbox, "onblur", "_onBlur");
  33. }
  34. });
  35. });