4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-form-field-Base'>/**
19 </span> * @docauthor Jason Johnston <jason@sencha.com>
21 * Base class for form fields that provides default event handling, rendering, and other common functionality
22 * needed by all form field types. Utilizes the {@link Ext.form.field.Field} mixin for value handling and validation,
23 * and the {@link Ext.form.Labelable} mixin to provide label and error message display.
25 * In most cases you will want to use a subclass, such as {@link Ext.form.field.Text} or {@link Ext.form.field.Checkbox},
26 * rather than creating instances of this class directly. However if you are implementing a custom form field,
27 * using this as the parent class is recommended.
29 * # Values and Conversions
31 * Because BaseField implements the Field mixin, it has a main value that can be initialized with the
32 * {@link #value} config and manipulated via the {@link #getValue} and {@link #setValue} methods. This main
33 * value can be one of many data types appropriate to the current field, for instance a {@link Ext.form.field.Date Date}
34 * field would use a JavaScript Date object as its value type. However, because the field is rendered as a HTML
35 * input, this value data type can not always be directly used in the rendered field.
37 * Therefore BaseField introduces the concept of a "raw value". This is the value of the rendered HTML input field,
38 * and is normally a String. The {@link #getRawValue} and {@link #setRawValue} methods can be used to directly
39 * work with the raw value, though it is recommended to use getValue and setValue in most cases.
41 * Conversion back and forth between the main value and the raw value is handled by the {@link #valueToRaw} and
42 * {@link #rawToValue} methods. If you are implementing a subclass that uses a non-String value data type, you
43 * should override these methods to handle the conversion.
47 * The content of the field body is defined by the {@link #fieldSubTpl} XTemplate, with its argument data
48 * created by the {@link #getSubTplData} method. Override this template and/or method to create custom
54 * // A simple subclass of BaseField that creates a HTML5 search field. Redirects to the
55 * // searchUrl when the Enter key is pressed.222
56 * Ext.define('Ext.form.SearchField', {
57 * extend: 'Ext.form.field.Base',
58 * alias: 'widget.searchfield',
60 * inputType: 'search',
62 * // Config defining the search URL
63 * searchUrl: 'http://www.google.com/search?q={0}',
65 * // Add specialkey listener
66 * initComponent: function() {
68 * this.on('specialkey', this.checkEnterKey, this);
71 * // Handle enter key presses, execute the search if the field has a value
72 * checkEnterKey: function(field, e) {
73 * var value = this.getValue();
74 * if (e.getKey() === e.ENTER && !Ext.isEmpty(value)) {
75 * location.href = Ext.String.format(this.searchUrl, value);
80 * Ext.create('Ext.form.Panel', {
81 * title: 'BaseField Example',
85 * // Fields will be arranged vertically, stretched to full width
91 * xtype: 'searchfield',
92 * fieldLabel: 'Search',
95 * renderTo: Ext.getBody()
98 Ext.define('Ext.form.field.Base', {
99 extend: 'Ext.Component',
101 labelable: 'Ext.form.Labelable',
102 field: 'Ext.form.field.Field'
104 alias: 'widget.field',
105 alternateClassName: ['Ext.form.Field', 'Ext.form.BaseField'],
106 requires: ['Ext.util.DelayedTask', 'Ext.XTemplate', 'Ext.layout.component.field.Field'],
108 <span id='Ext-form-field-Base-cfg-fieldSubTpl'> /**
109 </span> * @cfg {Ext.XTemplate} fieldSubTpl
110 * The content of the field body is defined by this config option.
112 fieldSubTpl: [ // note: {id} here is really {inputId}, but {cmpId} is available
113 '<input id="{id}" type="{type}" ',
114 '<tpl if="name">name="{name}" </tpl>',
115 '<tpl if="size">size="{size}" </tpl>',
116 '<tpl if="tabIdx">tabIndex="{tabIdx}" </tpl>',
117 'class="{fieldCls} {typeCls}" autocomplete="off" />',
124 <span id='Ext-form-field-Base-cfg-name'> /**
125 </span> * @cfg {String} name
126 * The name of the field. This is used as the parameter name when including the field value
127 * in a {@link Ext.form.Basic#submit form submit()}. If no name is configured, it falls back to the {@link #inputId}.
128 * To prevent the field from being included in the form submit, set {@link #submitValue} to false.
131 <span id='Ext-form-field-Base-cfg-inputType'> /**
132 </span> * @cfg {String} inputType
133 * The type attribute for input fields -- e.g. radio, text, password, file. The extended types
134 * supported by HTML5 inputs (url, email, etc.) may also be used, though using them will cause older browsers to
135 * fall back to 'text'.
137 * The type 'password' must be used to render that field type currently -- there is no separate Ext component for
138 * that. You can use {@link Ext.form.field.File} which creates a custom-rendered file upload field, but if you want
139 * a plain unstyled file input you can use a BaseField with inputType:'file'.
143 <span id='Ext-form-field-Base-cfg-tabIndex'> /**
144 </span> * @cfg {Number} tabIndex
145 * The tabIndex for this field. Note this only applies to fields that are rendered, not those which are built via
149 <span id='Ext-form-field-Base-cfg-invalidText'> /**
150 </span> * @cfg {String} invalidText
151 * The error text to use when marking a field invalid and no message is provided
153 invalidText : 'The value in this field is invalid',
155 <span id='Ext-form-field-Base-cfg-fieldCls'> /**
156 </span> * @cfg {String} [fieldCls='x-form-field']
157 * The default CSS class for the field input
159 fieldCls : Ext.baseCSSPrefix + 'form-field',
161 <span id='Ext-form-field-Base-cfg-fieldStyle'> /**
162 </span> * @cfg {String} fieldStyle
163 * Optional CSS style(s) to be applied to the {@link #inputEl field input element}. Should be a valid argument to
164 * {@link Ext.Element#applyStyles}. Defaults to undefined. See also the {@link #setFieldStyle} method for changing
165 * the style after initialization.
168 <span id='Ext-form-field-Base-cfg-focusCls'> /**
169 </span> * @cfg {String} [focusCls='x-form-focus']
170 * The CSS class to use when the field receives focus
172 focusCls : Ext.baseCSSPrefix + 'form-focus',
174 <span id='Ext-form-field-Base-cfg-dirtyCls'> /**
175 </span> * @cfg {String} dirtyCls
176 * The CSS class to use when the field value {@link #isDirty is dirty}.
178 dirtyCls : Ext.baseCSSPrefix + 'form-dirty',
180 <span id='Ext-form-field-Base-cfg-checkChangeEvents'> /**
181 </span> * @cfg {String[]} checkChangeEvents
182 * A list of event names that will be listened for on the field's {@link #inputEl input element}, which will cause
183 * the field's value to be checked for changes. If a change is detected, the {@link #change change event} will be
184 * fired, followed by validation if the {@link #validateOnChange} option is enabled.
186 * Defaults to ['change', 'propertychange'] in Internet Explorer, and ['change', 'input', 'textInput', 'keyup',
187 * 'dragdrop'] in other browsers. This catches all the ways that field values can be changed in most supported
188 * browsers; the only known exceptions at the time of writing are:
190 * - Safari 3.2 and older: cut/paste in textareas via the context menu, and dragging text into textareas
191 * - Opera 10 and 11: dragging text into text fields and textareas, and cut via the context menu in text fields
193 * - Opera 9: Same as Opera 10 and 11, plus paste from context menu in text fields and textareas
195 * If you need to guarantee on-the-fly change notifications including these edge cases, you can call the
196 * {@link #checkChange} method on a repeating interval, e.g. using {@link Ext.TaskManager}, or if the field is within
197 * a {@link Ext.form.Panel}, you can use the FormPanel's {@link Ext.form.Panel#pollForChanges} configuration to set up
198 * such a task automatically.
200 checkChangeEvents: Ext.isIE && (!document.documentMode || document.documentMode < 9) ?
201 ['change', 'propertychange'] :
202 ['change', 'input', 'textInput', 'keyup', 'dragdrop'],
204 <span id='Ext-form-field-Base-cfg-checkChangeBuffer'> /**
205 </span> * @cfg {Number} checkChangeBuffer
206 * Defines a timeout in milliseconds for buffering {@link #checkChangeEvents} that fire in rapid succession.
207 * Defaults to 50 milliseconds.
209 checkChangeBuffer: 50,
211 componentLayout: 'field',
213 <span id='Ext-form-field-Base-cfg-readOnly'> /**
214 </span> * @cfg {Boolean} readOnly
215 * true to mark the field as readOnly in HTML.
217 * **Note**: this only sets the element's readOnly DOM attribute. Setting `readOnly=true`, for example, will not
218 * disable triggering a ComboBox or Date; it gives you the option of forcing the user to choose via the trigger
219 * without typing in the text box. To hide the trigger use `{@link Ext.form.field.Trigger#hideTrigger hideTrigger}`.
223 <span id='Ext-form-field-Base-cfg-readOnlyCls'> /**
224 </span> * @cfg {String} readOnlyCls
225 * The CSS class applied to the component's main element when it is {@link #readOnly}.
227 readOnlyCls: Ext.baseCSSPrefix + 'form-readonly',
229 <span id='Ext-form-field-Base-cfg-inputId'> /**
230 </span> * @cfg {String} inputId
231 * The id that will be given to the generated input DOM element. Defaults to an automatically generated id. If you
232 * configure this manually, you must make sure it is unique in the document.
235 <span id='Ext-form-field-Base-cfg-validateOnBlur'> /**
236 </span> * @cfg {Boolean} validateOnBlur
237 * Whether the field should validate when it loses focus. This will cause fields to be validated
238 * as the user steps through the fields in the form regardless of whether they are making changes to those fields
239 * along the way. See also {@link #validateOnChange}.
241 validateOnBlur: true,
246 baseCls: Ext.baseCSSPrefix + 'field',
248 maskOnDisable: false,
251 initComponent : function() {
256 me.subTplData = me.subTplData || {};
259 <span id='Ext-form-field-Base-event-focus'> /**
260 </span> * @event focus
261 * Fires when this field receives input focus.
262 * @param {Ext.form.field.Base} this
265 <span id='Ext-form-field-Base-event-blur'> /**
266 </span> * @event blur
267 * Fires when this field loses input focus.
268 * @param {Ext.form.field.Base} this
271 <span id='Ext-form-field-Base-event-specialkey'> /**
272 </span> * @event specialkey
273 * Fires when any key related to navigation (arrows, tab, enter, esc, etc.) is pressed. To handle other keys
274 * see {@link Ext.util.KeyMap}. You can check {@link Ext.EventObject#getKey} to determine which key was
275 * pressed. For example:
277 * var form = new Ext.form.Panel({
280 * fieldLabel: 'Field 1',
284 * fieldLabel: 'Field 2',
287 * specialkey: function(field, e){
288 * // e.HOME, e.END, e.PAGE_UP, e.PAGE_DOWN,
289 * // e.TAB, e.ESC, arrow keys: e.LEFT, e.RIGHT, e.UP, e.DOWN
290 * if (e.{@link Ext.EventObject#getKey getKey()} == e.ENTER) {
291 * var form = field.up('form').getForm();
301 * @param {Ext.form.field.Base} this
302 * @param {Ext.EventObject} e The event object
311 // Default name to inputId
313 me.name = me.getInputId();
317 <span id='Ext-form-field-Base-method-getInputId'> /**
318 </span> * Returns the input id for this field. If none was specified via the {@link #inputId} config, then an id will be
319 * automatically generated.
321 getInputId: function() {
322 return this.inputId || (this.inputId = Ext.id());
325 <span id='Ext-form-field-Base-method-getSubTplData'> /**
326 </span> * Creates and returns the data object to be used when rendering the {@link #fieldSubTpl}.
327 * @return {Object} The template data
330 getSubTplData: function() {
333 inputId = me.getInputId();
335 return Ext.applyIf(me.subTplData, {
338 name: me.name || inputId,
342 fieldCls: me.fieldCls,
344 typeCls: Ext.baseCSSPrefix + 'form-' + (type === 'password' ? 'text' : type)
348 afterRender: function() {
352 this.inputEl.selectable();
356 <span id='Ext-form-field-Base-method-getSubTplMarkup'> /**
357 </span> * Gets the markup to be inserted into the outer template's bodyEl. For fields this is the actual input element.
359 getSubTplMarkup: function() {
360 return this.getTpl('fieldSubTpl').apply(this.getSubTplData());
363 initRenderTpl: function() {
365 if (!me.hasOwnProperty('renderTpl')) {
366 me.renderTpl = me.getTpl('labelableRenderTpl');
368 return me.callParent();
371 initRenderData: function() {
372 return Ext.applyIf(this.callParent(), this.getLabelableRenderData());
375 <span id='Ext-form-field-Base-method-setFieldStyle'> /**
376 </span> * Set the {@link #fieldStyle CSS style} of the {@link #inputEl field input element}.
377 * @param {String/Object/Function} style The style(s) to apply. Should be a valid argument to {@link
378 * Ext.Element#applyStyles}.
380 setFieldStyle: function(style) {
382 inputEl = me.inputEl;
384 inputEl.applyStyles(style);
386 me.fieldStyle = style;
390 onRender : function() {
392 fieldStyle = me.fieldStyle;
394 me.onLabelableRender();
396 <span id='Ext-form-field-Base-property-inputEl'> /**
397 </span> * @property {Ext.Element} inputEl
398 * The input Element for this Field. Only available after the field has been rendered.
400 me.addChildEls({ name: 'inputEl', id: me.getInputId() });
402 me.callParent(arguments);
404 // Make the stored rawValue get set as the input element's value
405 me.setRawValue(me.rawValue);
408 me.setReadOnly(true);
414 me.setFieldStyle(fieldStyle);
417 me.renderActiveError();
420 initAria: function() {
424 // Associate the field to the error message element
425 me.getActionEl().dom.setAttribute('aria-describedby', Ext.id(me.errorEl));
428 getFocusEl: function() {
432 isFileUpload: function() {
433 return this.inputType === 'file';
436 extractFileInput: function() {
438 fileInput = me.isFileUpload() ? me.inputEl.dom : null,
441 clone = fileInput.cloneNode(true);
442 fileInput.parentNode.replaceChild(clone, fileInput);
443 me.inputEl = Ext.get(clone);
448 // private override to use getSubmitValue() as a convenience
449 getSubmitData: function() {
453 if (!me.disabled && me.submitValue && !me.isFileUpload()) {
454 val = me.getSubmitValue();
457 data[me.getName()] = val;
463 <span id='Ext-form-field-Base-method-getSubmitValue'> /**
464 </span> * Returns the value that would be included in a standard form submit for this field. This will be combined with the
465 * field's name to form a name=value pair in the {@link #getSubmitData submitted parameters}. If an empty string is
466 * returned then just the name= will be submitted; if null is returned then nothing will be submitted.
468 * Note that the value returned will have been {@link #processRawValue processed} but may or may not have been
469 * successfully {@link #validate validated}.
471 * @return {String} The value to be submitted, or null.
473 getSubmitValue: function() {
474 return this.processRawValue(this.getRawValue());
477 <span id='Ext-form-field-Base-method-getRawValue'> /**
478 </span> * Returns the raw value of the field, without performing any normalization, conversion, or validation. To get a
479 * normalized and converted value see {@link #getValue}.
480 * @return {String} value The raw String value of the field
482 getRawValue: function() {
484 v = (me.inputEl ? me.inputEl.getValue() : Ext.value(me.rawValue, ''));
489 <span id='Ext-form-field-Base-method-setRawValue'> /**
490 </span> * Sets the field's raw value directly, bypassing {@link #valueToRaw value conversion}, change detection, and
491 * validation. To set the value with these additional inspections see {@link #setValue}.
492 * @param {Object} value The value to set
493 * @return {Object} value The field value that is set
495 setRawValue: function(value) {
497 value = Ext.value(value, '');
500 // Some Field subclasses may not render an inputEl
502 me.inputEl.dom.value = value;
507 <span id='Ext-form-field-Base-method-valueToRaw'> /**
508 </span> * Converts a mixed-type value to a raw representation suitable for displaying in the field. This allows controlling
509 * how value objects passed to {@link #setValue} are shown to the user, including localization. For instance, for a
510 * {@link Ext.form.field.Date}, this would control how a Date object passed to {@link #setValue} would be converted
511 * to a String for display in the field.
513 * See {@link #rawToValue} for the opposite conversion.
515 * The base implementation simply does a standard toString conversion, and converts {@link Ext#isEmpty empty values}
516 * to an empty string.
518 * @param {Object} value The mixed-type value to convert to the raw representation.
519 * @return {Object} The converted raw value.
521 valueToRaw: function(value) {
522 return '' + Ext.value(value, '');
525 <span id='Ext-form-field-Base-method-rawToValue'> /**
526 </span> * Converts a raw input field value into a mixed-type value that is suitable for this particular field type. This
527 * allows controlling the normalization and conversion of user-entered values into field-type-appropriate values,
528 * e.g. a Date object for {@link Ext.form.field.Date}, and is invoked by {@link #getValue}.
530 * It is up to individual implementations to decide how to handle raw values that cannot be successfully converted
531 * to the desired object type.
533 * See {@link #valueToRaw} for the opposite conversion.
535 * The base implementation does no conversion, returning the raw value untouched.
537 * @param {Object} rawValue
538 * @return {Object} The converted value.
540 rawToValue: function(rawValue) {
544 <span id='Ext-form-field-Base-method-processRawValue'> /**
545 </span> * Performs any necessary manipulation of a raw field value to prepare it for {@link #rawToValue conversion} and/or
546 * {@link #validate validation}, for instance stripping out ignored characters. In the base implementation it does
547 * nothing; individual subclasses may override this as needed.
549 * @param {Object} value The unprocessed string value
550 * @return {Object} The processed string value
552 processRawValue: function(value) {
556 <span id='Ext-form-field-Base-method-getValue'> /**
557 </span> * Returns the current data value of the field. The type of value returned is particular to the type of the
558 * particular field (e.g. a Date object for {@link Ext.form.field.Date}), as the result of calling {@link #rawToValue} on
559 * the field's {@link #processRawValue processed} String value. To return the raw String value, see {@link #getRawValue}.
560 * @return {Object} value The field value
562 getValue: function() {
564 val = me.rawToValue(me.processRawValue(me.getRawValue()));
569 <span id='Ext-form-field-Base-method-setValue'> /**
570 </span> * Sets a data value into the field and runs the change detection and validation. To set the value directly
571 * without these inspections see {@link #setRawValue}.
572 * @param {Object} value The value to set
573 * @return {Ext.form.field.Field} this
575 setValue: function(value) {
577 me.setRawValue(me.valueToRaw(value));
578 return me.mixins.field.setValue.call(me, value);
583 onDisable: function() {
585 inputEl = me.inputEl;
588 inputEl.dom.disabled = true;
593 onEnable: function() {
595 inputEl = me.inputEl;
598 inputEl.dom.disabled = false;
602 <span id='Ext-form-field-Base-method-setReadOnly'> /**
603 </span> * Sets the read only state of this field.
604 * @param {Boolean} readOnly Whether the field should be read only.
606 setReadOnly: function(readOnly) {
608 inputEl = me.inputEl;
610 inputEl.dom.readOnly = readOnly;
611 inputEl.dom.setAttribute('aria-readonly', readOnly);
613 me[readOnly ? 'addCls' : 'removeCls'](me.readOnlyCls);
614 me.readOnly = readOnly;
618 fireKey: function(e){
619 if(e.isSpecialKey()){
620 this.fireEvent('specialkey', this, Ext.create('Ext.EventObjectImpl', e));
625 initEvents : function(){
627 inputEl = me.inputEl,
631 me.mon(inputEl, Ext.EventManager.getKeyEvent(), me.fireKey, me);
632 me.mon(inputEl, 'focus', me.onFocus, me);
634 // standardise buffer across all browsers + OS-es for consistent event order.
635 // (the 10ms buffer for Editors fixes a weird FF/Win editor issue when changing OS window focus)
636 me.mon(inputEl, 'blur', me.onBlur, me, me.inEditor ? {buffer:10} : null);
638 // listen for immediate value changes
639 onChangeTask = Ext.create('Ext.util.DelayedTask', me.checkChange, me);
640 me.onChangeEvent = onChangeEvent = function() {
641 onChangeTask.delay(me.checkChangeBuffer);
643 Ext.each(me.checkChangeEvents, function(eventName) {
644 if (eventName === 'propertychange') {
645 me.usesPropertychange = true;
647 me.mon(inputEl, eventName, onChangeEvent);
653 doComponentLayout: function() {
655 inputEl = me.inputEl,
656 usesPropertychange = me.usesPropertychange,
657 ename = 'propertychange',
658 onChangeEvent = me.onChangeEvent;
660 // In IE if propertychange is one of the checkChangeEvents, we need to remove
661 // the listener prior to layout and re-add it after, to prevent it from firing
662 // needlessly for attribute and style changes applied to the inputEl.
663 if (usesPropertychange) {
664 me.mun(inputEl, ename, onChangeEvent);
666 me.callParent(arguments);
667 if (usesPropertychange) {
668 me.mon(inputEl, ename, onChangeEvent);
673 preFocus: Ext.emptyFn,
676 onFocus: function() {
678 focusCls = me.focusCls,
679 inputEl = me.inputEl;
681 if (focusCls && inputEl) {
682 inputEl.addCls(focusCls);
686 me.componentLayout.onFocus();
687 me.fireEvent('focus', me);
692 beforeBlur : Ext.emptyFn,
697 focusCls = me.focusCls,
698 inputEl = me.inputEl;
705 if (focusCls && inputEl) {
706 inputEl.removeCls(focusCls);
708 if (me.validateOnBlur) {
712 me.fireEvent('blur', me);
717 postBlur : Ext.emptyFn,
720 <span id='Ext-form-field-Base-method-onDirtyChange'> /**
721 </span> * @private Called when the field's dirty state changes. Adds/removes the {@link #dirtyCls} on the main element.
722 * @param {Boolean} isDirty
724 onDirtyChange: function(isDirty) {
725 this[isDirty ? 'addCls' : 'removeCls'](this.dirtyCls);
729 <span id='Ext-form-field-Base-method-isValid'> /**
730 </span> * Returns whether or not the field value is currently valid by {@link #getErrors validating} the
731 * {@link #processRawValue processed raw value} of the field. **Note**: {@link #disabled} fields are
732 * always treated as valid.
734 * @return {Boolean} True if the value is valid, else false
736 isValid : function() {
738 return me.disabled || me.validateValue(me.processRawValue(me.getRawValue()));
742 <span id='Ext-form-field-Base-method-validateValue'> /**
743 </span> * Uses {@link #getErrors} to build an array of validation errors. If any errors are found, they are passed to
744 * {@link #markInvalid} and false is returned, otherwise true is returned.
746 * Previously, subclasses were invited to provide an implementation of this to process validations - from 3.2
747 * onwards {@link #getErrors} should be overridden instead.
749 * @param {Object} value The value to validate
750 * @return {Boolean} True if all validations passed, false if one or more failed
752 validateValue: function(value) {
754 errors = me.getErrors(value),
755 isValid = Ext.isEmpty(errors);
756 if (!me.preventMark) {
760 me.markInvalid(errors);
767 <span id='Ext-form-field-Base-method-markInvalid'> /**
768 </span> * Display one or more error messages associated with this field, using {@link #msgTarget} to determine how to
769 * display the messages and applying {@link #invalidCls} to the field's UI element.
771 * **Note**: this method does not cause the Field's {@link #validate} or {@link #isValid} methods to return `false`
772 * if the value does _pass_ validation. So simply marking a Field as invalid will not prevent submission of forms
773 * submitted with the {@link Ext.form.action.Submit#clientValidation} option set.
775 * @param {String/String[]} errors The validation message(s) to display.
777 markInvalid : function(errors) {
778 // Save the message and fire the 'invalid' event
780 oldMsg = me.getActiveError();
781 me.setActiveErrors(Ext.Array.from(errors));
782 if (oldMsg !== me.getActiveError()) {
783 me.doComponentLayout();
787 <span id='Ext-form-field-Base-method-clearInvalid'> /**
788 </span> * Clear any invalid styles/messages for this field.
790 * **Note**: this method does not cause the Field's {@link #validate} or {@link #isValid} methods to return `true`
791 * if the value does not _pass_ validation. So simply clearing a field's errors will not necessarily allow
792 * submission of forms submitted with the {@link Ext.form.action.Submit#clientValidation} option set.
794 clearInvalid : function() {
795 // Clear the message and fire the 'valid' event
797 hadError = me.hasActiveError();
798 me.unsetActiveError();
800 me.doComponentLayout();
804 <span id='Ext-form-field-Base-method-renderActiveError'> /**
805 </span> * @private Overrides the method from the Ext.form.Labelable mixin to also add the invalidCls to the inputEl,
806 * as that is required for proper styling in IE with nested fields (due to lack of child selector)
808 renderActiveError: function() {
810 hasError = me.hasActiveError();
812 // Add/remove invalid class
813 me.inputEl[hasError ? 'addCls' : 'removeCls'](me.invalidCls + '-field');
815 me.mixins.labelable.renderActiveError.call(me);
819 getActionEl: function() {
820 return this.inputEl || this.el;