Results 1 to 3 of 3

Thread: Does submitOnAction work in 1.0.1? Doesn't seem like it does anything

  1. #1
    Touch Premium Member
    Join Date
    Jun 2010
    Posts
    324
    Vote Rating
    2
      0  

    Default Does submitOnAction work in 1.0.1? Doesn't seem like it does anything

    I've added submitOnAction: true to an Ext.form.FormPanel. Hitting enter on the keyboard does nothing. Is this a bug?

  2. #2
    Touch Premium Member
    Join Date
    Jan 2011
    Posts
    12
    Vote Rating
    0
      0  

    Default +1

    Same problem. Android, Phonegap.

  3. #3
    Sencha Premium Member
    Join Date
    May 2008
    Location
    Pasadena, California
    Posts
    172
    Vote Rating
    2
      0  

    Default submitOnAction login example

    Not sure if this is of any help, but here is an example login screen that utilizes the submitOnAction (the enter key on a desktop at least). It contains a 'Login' button which just invokes submit() and the formpanel has the url and method properties set, which are required to do this. also, the success callback logic goes in the submit listener and the failure callback logic goes in the exception listener.

    Code:
    {
            id:'Authentication',
            fullscreen: true,
            cls:'ts-list-panel',
            xtype:'formpanel',
            submitOnAction:true,
            url: vm.environ.server.routePrefix + '/login',
            listeners:{
                'submit': function(form, responseObj) {
                    form.setLoading(false);
                    if (responseObj.success) {
                        vm.setUser(responseObj.payload.user);
                        vm.activateItem('Main');
                    }
                    else {
                        vm.setUser(null);
                        panelLaunch({
                            iconClass: 'x-panel-action-icon-tick',
                            position: 'br',
                            actionMethod: ['hide']
                        }, responseObj.message);
                    }
                },
                'exception': function(form, response) {
                    form.setLoading(false);
                    var responseText = (response.responseText ? response.responseText : 'Unable to contact the server.  Please try again later.');
                    panelLaunch({
                        iconClass: 'x-panel-action-icon-tick',
                        position: 'br',
                        actionMethod: ['hide']
                    }, responseText);
                }
            },
            method: 'POST',
            layout: (Ext.is.Phone?'fit':{type:'vbox',
                    align:'center'
                    ,pack:'center'
                }),
            width: '100%',
            height: '100%',
            dockedItems: [
                {
                    dock : 'bottom',
                    xtype: 'toolbar',
                    ui   : 'light'
                }
            ],
            items:[
                {
                    xtype:'panel',
                    layout: {
                        type: 'hbox',
                        align:'center'
                        ,pack:'center'
                    },
                    items: [
                        {
                            xtype: 'panel',
                            height: 140,
                            width: 140,
                            baseCls: 'ts-logo'
                        },
                        {
                            items: [
                                {
                                    xtype: 'textfield',
                                    name : 'username',
                                    label: 'Username'
                                },
                                {
                                    xtype: 'passwordfield',
                                    name : 'password',
                                    label: 'Password'
                                },
                                {
                                    dock : 'bottom',
                                    xtype: 'toolbar',
                                    ui   : 'light',
                                    items: [
                                        {
                                            text: 'Login',
                                            handler: function(button) {
                                                var form = Ext.getCmp('Authentication');
                                                form.setLoading({msg:"Authenticating..."}, false);
                                                form.submit();
                                            }
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }

Similar Threads

  1. TreeSorter doesn't work
    By ReSeT in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 6 Mar 2008, 5:02 AM
  2. XmlReader doesn't work
    By sempf in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 5 Mar 2008, 7:30 AM
  3. Form Json Submit doesn't work but the Load work
    By dieyoudie in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 14 Dec 2007, 2:13 PM
  4. Code won't work in IE7, no JS errors, just doesn't work
    By blackwaterdev in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 17 Sep 2007, 5:06 AM

Posting Permissions

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