REQUIRED INFORMATION

Ext version tested:
  • ext-4.1.1a-gpl
Browser versions tested against:
  • Chrome 23.0.1271.101
DOCTYPE tested against:
Code:
<!DOCTYPE html>
Description:
  • On form fields, setting allowOnlyWhitespace to false does not trigger buttons with formBind set to true to enable or disable based on the field validation. You must also set allowBlank to false, despite the fact that the documentation says setting allowOnlyWhitespace to false also sets allowBlank to false.
Steps to reproduce the problem:
  • Create form with one field with allowBlank and allowOnlyWhitespace set to false and a second field with only allowOnlyWhitespace set to false.
  • Create a button on the form with formBind set to true.
The result that was expected:
  • Both fields should be validated to have valid text before the button is enabled.
The result that occurs instead:
  • Entering text for the first field (with both allowOnlyWhitespace and allowBlank set to false) enables the button.
Test Case:

Code:
Ext.onReady(function() {
    var form = Ext.create('Ext.form.Panel', {
      plain: true,
      items: [
        {
          xtype: 'textfield',
          fieldLabel: 'Field 1',
          name: 'field1',
          allowBlank: false,
          allowOnlyWhitespace: false
        },
        {
          xtype: 'textfield',
          fieldLabel: 'Field 1',
          name: 'field2',
          allowOnlyWhitespace: false
        }
      ],
      buttons: [
        {
          action: 'reset',
          text: 'Reset Form'
        },
        {
          action: 'create',
          text: 'Create',
          formBind: true
        }
      ]
    });


    var win = Ext.create('Ext.window.Window', {
      title: 'Form',
      minWidth: 300,
      minHeight: 200,
      layout: 'fit',
      items: form
    });


    win.show();
  });

HELPFUL INFORMATION

Additional CSS used:
  • only default ext-all.css
Operating System:
  • OS X 10.8.2