Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Feb 2009
    Posts
    107
    Vote Rating
    0
    marman is on a distinguished road

      0  

    Default Ext.Direct missing URL in subclassed Form

    Ext.Direct missing URL in subclassed Form


    REQUIRED INFORMATION Ext version tested:
    • Ext 4.02 rev
    Browser versions tested against:
    • FF 5 (firebug 1.3.0.10 installed)
    Description:
    • Using Ext.direct with a Form. On the server I am using the ExtDirectSpring 1.10. I can upload that code if needed although my project is big.
    • If i simply have a form in my app.js, everything works as the attached example shows (green in picture)
    • However when I leverage the Class system and take that form code, extend Ext.form.Panel and use an instance of that, the URL for the Ext.Direct is not correct. (see red in picture)
    • if I change the namespace on the 'api' parameter to an invalid one, like: load: iamSummaryService2.getIamSummary, i get an error, so it has to know about the direct service
    Steps to reproduce the problem:
    • Use Ext.Direct on a sub-classed form
    The result that was expected:
    • The correct Ext.Direct URL would be used
    The result that occurs instead:
    • foo
    • bar
    Test Case:
    Code:
         <html>
    <head>
        <title>Hello Ext</title>
     
        <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css">
        
        <script type="text/javascript" src="ext-all-debug.js"></script>
        
        <script type="text/javascript" src="./action/api-debug.js"></script>
        <script type="text/javascript" src="app.js"></script>
    </head>
    <body></body>
    </html>
    app.js
    Code:
    Ext.Loader.setConfig({
        enabled: true
    });
    
    
    Ext.onReady(function() {
        
        Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);
        
        // provide feedback for any errors
        Ext.tip.QuickTipManager.init();
                
        
        //--cut and pasted code from class: SABER.summary.D03Summary
        var form= Ext.create('Ext.form.Panel', { 
            border: false,
            width: 400,
            bodyPadding: 10,
            paramsAsHash: true,
            
            items: [{
                xtype: 'textfield',
                name: 'totalToday',
                readOnly: true,
                width: 380,
                fieldLabel: 'Total (today)',        
            }, {
                xtype: 'textfield',
                name: 'totalInFiles',
                readOnly: true,
                width: 380,
                fieldLabel: 'Total In Files'
            }, {
                xtype: 'textfield',
                name: 'totalLoaded',
                readOnly: true,
                width: 380,
                fieldLabel: 'Total Loaded'            
            }],
            
            api: {
                load: iamSummaryService.getIamSummary
            }
        });    
        
        //--This calls the proper URL and works fine!
        form.getForm().load();    
        
        var summary= Ext.create('SABER.summary.D03Summary');
        //summary.api = 'load: iamSummaryService2.getIamSummary';
            
        //--This does not call the proper URL. it is calling the root url of the deployed application.
        //--it is as if it does not see the direct data from the: Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);
        summary.getForm().load();
            
    
            
            var viewport= Ext.create('Ext.container.Viewport', 
                    {
                        layout: 'auto',
                        items: [ {
                            region: 'north',
                            html: '<h1 class="x-panel-header">Page Title</h1>',
                            height: 100,
                            border: true,
                            margins: '0 0 5 0'
                        }, {
                            region: 'center',
                            border: true,
                            layout: {
                                type: 'hbox',
                            },
    
                            items: [ form, summary ]
                        }, {
                            region: 'south',
                            html: '<h1 class="x-panel-header">Page Footer</h1>',
                            height: 80,
                            border: true,
                            margins: '0 0 5 0'
                        }, ]            
                    });
       
    });
    D03Summary.js
    Code:
    Ext.define('SABER.summary.D03Summary', { 
        extend: 'Ext.form.Panel',
          
        border: false,
        width: 400,
        bodyPadding: 10,
        paramsAsHash: true,
        
        items: [{
            xtype: 'textfield',
            name: 'totalToday',
            readOnly: true,
            width: 380,
            fieldLabel: 'Total (today)',        
        }, {
            xtype: 'textfield',
            name: 'totalInFiles',
            readOnly: true,
            width: 380,
            fieldLabel: 'Total In Files'
        }, {
            xtype: 'textfield',
            name: 'totalLoaded',
            readOnly: true,
            width: 380,
            fieldLabel: 'Total Loaded'            
        }],
        
        api: {
            load: iamSummaryService.getIamSummary
        }
    });
    Code:
    package com.xxx.saber;
    
    
    import org.springframework.stereotype.Component;
    
    import ch.ralscha.extdirectspring.annotation.ExtDirectMethod;
    import ch.ralscha.extdirectspring.annotation.ExtDirectMethodType;
    
    
    @Component
    public class IamSummaryService
    {
    
        @ExtDirectMethod(ExtDirectMethodType.FORM_LOAD)
        public IamSummary getIamSummary()
        {
            System.out.println("Hi!!!!!!!!!!!!!!!!!");
            
            IamSummary i = new IamSummary();
            i.setDayId( 20110719 );
            i.setTotalToday( 52222222 );
            i.setTotalInFiles( 500000 );
            i.setTotalLoaded( 499858 );
            return i;
        }
    }
    HELPFUL INFORMATION Screenshot or Video:
    • attached
    Debugging already done:
    • some use of Firebug.
    Possible fix:
    • not provided
    Additional CSS used:
    • only default ext-all.css
    Operating System:
    • Windows 7 Professional
    Attached Images

  2. #2
    Sencha User
    Join Date
    Feb 2009
    Posts
    107
    Vote Rating
    0
    marman is on a distinguished road

      0  

    Default


    any thoughts on this?

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    60
    Vote Rating
    2
    ralscha is on a distinguished road

      0  

    Default


    The problem is that api is not a property of Ext.form.Panel. api is part of Ext.form.Basic

    You could try this:
    Code:
     Ext.define('SABER.summary.D03Summary', { 
            extend: 'Ext.form.Panel',
              
            border: false,
            .....
         	initComponent: function() {	
        		this.callParent();  
        		this.getForm().api = {
                    load: iamSummaryService.getIamSummary
                };    		  
        	} 
    }
    or

    Code:
    var summary= Ext.create('SABER.summary.D03Summary');
    summary.getForm().api = {load: iamSummaryService.getIamSummary};
    Here another forum posting that talks about this problem:
    http://www.sencha.com/forum/showthre...-(MCV-approach)

  4. #4
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    60
    Vote Rating
    2
    ralscha is on a distinguished road

      0  

    Default


    To make it work with extdirectspring paramsAsHash has to be true. This is also not a property of Ext.form.Panel. You have to set it on the BasicForm.

    This way it should work:

    Code:
     Ext.define('SABER.summary.D03Summary', { 
            extend: 'Ext.form.Panel',
              
            border: false,
            //remove this paramsAsHash: true,
            .....
    	initComponent: function() {
    		this.initialConfig = {
    			api: {
    				load: iamSummaryService.getIamSummary
    			},
    			paramsAsHash: true
    		};
    
    		this.callParent();
    	}
    });

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar