Results 1 to 4 of 4

Thread: NS_ERROR_ILLEGAL_VALUE on directsubmit on extend based formpanel

  1. #1
    Ext User
    Join Date
    Sep 2007
    Posts
    11
    Vote Rating
    0
      0  

    Question NS_ERROR_ILLEGAL_VALUE on directsubmit on extend based formpanel

    Dear Specialists out there,

    Why is it that the first code will not work and the second does? When I hit the post button I get a ugly exception. cause of error. Looks like the form isn't posting using directsubmit but the normal submit without a url. Why ? api methods are lost ?


    Nice (correct ?) way but not working and giving this error

    uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://host/site/admin/ext/adapter/ext/ext-base.js :: i :: line 7" data: no]

    Line 0

    Code:
    Ext.ns('Admin');
    Admin.LoginPanel = Ext.extend(Ext.FormPanel, {
        labelAlign : 'right',
        frame : true,
        width : 350,
        border :false,
    	
        initComponent : function() {
    
            Ext.Direct.addProvider(Admin.Remoting.REMOTING_API);
    
            Ext.apply(this, {
                api : {
                    submit: Admin.Remoting.Base.login
                },
                paramsAsHash: false,
                items : [ {
                    xtype : 'textfield',
                    name : 'username',
                    allowBlank : false,
                    fieldLabel : 'Username',
                    anchor : '100%',
                    value : Ext.state.Manager.get('username')
                }, {
                    xtype : 'textfield',
                    name : 'password',
                    allowBlank : false,
                    fieldLabel : 'Password',
                    inputType : 'password',
                    anchor : '100%',
                    value : Ext.state.Manager.get('password')
                }, {
                    xtype : 'checkbox',
                    name : 'remember',
                    labelSeparator : '',
                    inputValue : 'on',
                    boxLabel : 'Remember me.',
                    value : Ext.state.Manager.get('remember')
                } ],
                buttons : [ {
                    text : 'Aanmelden',
                    id : 'submitbutton',
                    handler: function(){
                        this.getForm().submit();
                    }.createDelegate(this)
                }]
            });
    		
            Admin.LoginPanel.superclass.initComponent.apply(this, arguments);
        }
    });
    Ext.reg('admin.loginpanel', Admin.LoginPanel);
    less nice but working code

    Code:
    Ext.ns('Admin');
    Admin.LoginPanel = Ext.extend(Ext.Panel, {
        labelAlign : 'right',
        frame : true,
        width : 350,
        border :false,
    	
        initComponent : function() {
    
            Ext.Direct.addProvider(Admin.Remoting.REMOTING_API);
    
            var form = new Ext.FormPanel({
                api : {
                    submit: Admin.Remoting.Base.login
                },
                paramsAsHash: false,
                items : [ {
                    xtype : 'textfield',
                    name : 'username',
                    allowBlank : false,
                    fieldLabel : 'Username',
                    anchor : '100%',
                    value : Ext.state.Manager.get('username')
                }, {
                    xtype : 'textfield',
                    name : 'password',
                    allowBlank : false,
                    fieldLabel : 'Password',
                    inputType : 'password',
                    anchor : '100%',
                    value : Ext.state.Manager.get('password')
                }, {
                    xtype : 'checkbox',
                    name : 'remember',
                    labelSeparator : '',
                    inputValue : 'on',
                    boxLabel : 'Remember me.',
                    value : Ext.state.Manager.get('remember')
                } ],
                buttons : [ {
                    text : 'Aanmelden',
                    id : 'submitbutton',
                    handler: function(){
                        form.getForm().submit();
                    }.createDelegate(this)
                }]
            });
    
            Admin.LoginPanel.superclass.initComponent.apply(this, arguments);
    
            this.add(form);
        }
    });
    Ext.reg('admin.loginpanel', Admin.LoginPanel);
    In the second code, am I doing something wrong or is this a bug or isn't it ment to work that way. I prefer the second code because I need a to extend a formpanel and not a panel with a form.

    Im using version 3.0.0

    Im really curious and hoping I'm doing something wrong here

    Kind regards
    Ollie

  2. #2
    Ext User
    Join Date
    Sep 2007
    Posts
    11
    Vote Rating
    0
      0  

    Default Ext.Apply

    Code:
    Ext.apply(this, {
        api : {
    	submit: Admin.Remoting.Base.login
        }
    });
    is not working! When I store the config object in a var like

    Code:
    var config = {
        api : {
    	Admin.Remoting.Base.login
        }
    }
    and use

    Code:
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    it works!

  3. #3
    Ext User
    Join Date
    May 2007
    Posts
    4
    Vote Rating
    0
      0  

    Question Same Problem

    I had the same problem.. your solution worked for me. Why is this happening?

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    FormPanel creates an internal BasicForm using the initialConfig as configuration object.

    You should do this for all extended classes, because there are several more components that use the initialConfig to see how the component was originally configured.

Posting Permissions

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