source: Dev/branches/rest-dojo-ui/client/dojox/mobile/TextBox.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 1.2 KB
Line 
1define([
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        /*=====
10                WidgetBase = dijit._WidgetBase;
11                FormValueMixin = dijit.form._FormValueMixin;
12                TextBoxMixin = dijit.form._TextBoxMixin;
13        =====*/
14        return declare("dojox.mobile.TextBox",[WidgetBase, FormValueMixin, TextBoxMixin],{
15                // summary:
16                //              A non-templated base class for textbox form inputs
17
18                baseClass: "mblTextBox",
19
20                // Override automatic assigning type --> node, it causes exception on IE8.
21                // Instead, type must be specified as this.type when the node is created, as part of the original DOM
22                _setTypeAttr: null,
23
24                // Map widget attributes to DOMNode attributes.
25                _setPlaceHolderAttr: "textbox",
26
27                buildRendering: function(){
28                        if(!this.srcNodeRef){
29                                this.srcNodeRef = domConstruct.create("input", {"type":this.type});
30                        }
31                        this.inherited(arguments);
32                        this.textbox = this.focusNode = this.domNode;
33                },
34
35                postCreate: function(){
36                        this.inherited(arguments);
37                        this.connect(this.textbox, "onfocus", "_onFocus");
38                        this.connect(this.textbox, "onblur", "_onBlur");
39                }
40        });
41});
Note: See TracBrowser for help on using the repository browser.