Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Problem introduced into Ext.form.Panel in version 2.3.1 ?

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-5258 in Backlog.
  1. #1
    Ext GWT Premium Member
    Join Date
    Nov 2009
    Posts
    14

    Default Problem introduced into Ext.form.Panel in version 2.3.1 ?

    Hi,

    in Sencha Touch 2.3.1 in "Ext.form.Panel" the submit function starts like this:

    Code:
     submit: function(options, e) {
            var me = this,
                formValues = me.getValues(me.getStandardSubmit() || !options.submitDisabled),
                form = me.element.dom || {};
    ...
    I am using a form panel in my app which has the config option "submitOnAction: true" specified. When I hit enter on the formfield it seems like the method "onFieldAction" in "Ext.form.Panel" get called:

    Code:
     onFieldAction: function(field) {
            if (this.getSubmitOnAction()) {
                field.blur();
                this.submit();
            }
        }
    As this is calling the submit() method without any params the line containing "!options.submitDisabled" failes because options is undefined.

    Best,
    Ronald

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    I'm not sure that I am following you. The doc states that when submitOnAction is true.
    When this is set to true, the form will automatically submit itself whenever the action event fires on a field in this form. The action event usually fires whenever you press go or enter inside a textfield.
    What was the behavior you were expecting?
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  3. #3
    Ext GWT Premium Member
    Join Date
    Nov 2009
    Posts
    14

    Default

    Hi,

    the behaviour I expected is that the form submits itself. Which it does in version 2.3.0.

    I version 2.3.1 the method "onFieldAction" calls "this.submit();" without any parameters. Therefore the "submit" method which in the new version checks"!options.submitDisabled" fails because the options object is undefined.

    Best,
    Ronald

  4. #4
    Sencha User
    Join Date
    Aug 2007
    Posts
    17

    Default

    Having the same problem here. Calling the submit() method of an Ext.form.FormPanel without any options generates an error in 2.3.1.

    Here's a fiddle that works in 2.3.0:
    https://fiddle.sencha.com/#fiddle/1te

    But breaks in 2.3.1 (which I can't find in fiddle) with:
    Uncaught TypeError: Cannot read property 'submitDisabled' of undefined

  5. #5

    Default

    I'm experiencing the same problem. As ronaldploeger explained in his first post, if submitOnAction is set to true then it calls the submit without any parameters. But the submit method doesn't check whether options are defined or not; it directly uses it without checking. As a result it gives "options is undefined" error.

  6. #6
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Thanks @MarkP for the test case. I have opened a bug in our bug tracker. I apologize for the delay.

  7. #7
    Sencha User Kikketer's Avatar
    Join Date
    Apr 2012
    Location
    Wausau, WI
    Posts
    135

    Default

    Quote Originally Posted by fmoseley View Post
    Thanks @MarkP for the test case. I have opened a bug in our bug tracker. I apologize for the delay.
    Any news or workarounds for this issue?
    This is causing the submitOnAction functionality to fail completely, since there's no way to catch and inject this 'default' value.

    https://fiddle.sencha.com/#fiddle/3dg

    I found this issue when attempting to repeat the other issue I found trying to prevent a form from submitting... to be posted separately.

  8. #8
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Here's an override that should alleviate the issue.
    Code:
    Ext.define('Override.form.Panel', {
        override: 'Ext.form.Panel',
    
    
        submit: function (options, e) {
            options = options || {};
    
    
            return this.callParent([options, e]);
        }
    });
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  9. #9
    Sencha User
    Join Date
    Feb 2014
    Posts
    2

    Default

    Hi, i'm new with sencha,
    i tried to follow the tutorial for the first app, but i had this message whene i click on the button send, i did exactly the same code as in the video .
    The ERROR is : Cannot read property 'submitDisabled' of undefined.
    please i'm using sencha touch 2.3.1.
    sorry for my english.

    Code:
    Ext.define('GS.view.Contact',{
      extend: 'Ext.form.Panel',
      xtype:'contactform',
    
    
      requires:[
       'Ext.form.FieldSet',
       'Ext.field.Email'
      ],
    
    
      config:{
        title: 'Contact',
        iconCls: 'user',
        url:'contact.php',
    
    
        items:[
          {
           xtype:'fieldset',
           title:'Contact US',
           instructions : '(email is not required)',
    
    
           items:[
           {
              xtype:'textfield',
              name:'name',
              label:'Name'
           },
           {
              xtype:'emailfield',
              name:'email',
              label:'email'
           },
           {
              xtype:'textareafield',
              name:'message',
              label:'message'
           }
         ]
        },
        {
           xtype: 'button',
           text: 'Send',
           ui: 'confirm',
           handler: function() {
           this.up('contactform').submit();
        }
      }
            ]
    
    
        }
    });

  10. #10

    Default To Modib

    just copy code from fmoseley, and paste to your app.js
    Code:
    Ext.define('Override.form.Panel',{
    override: 'Ext.form.Panel', submit: function (options, e) {
    options = options || {}; return this.callParent([options, e]);
    }
    });
    Ahaha... it work's on my app

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •