1. #1
    Ext User
    Join Date
    Nov 2007
    Posts
    6
    Vote Rating
    0
    prabhupb is on a distinguished road

      0  

    Default Loading jsp content in the Panel

    Loading jsp content in the Panel


    Hello Guys,
    I'm very new to Ext.
    I have been trying something for the past 2/3 days and doesn't seem to be working out.

    This is what im trying to achieve:
    Create a Viewport using border layout.
    Then load the contents of a jsp page in the center panel. But things doesn't work well.

    Following is the code

    Create a Viewport using border layout
    Code:
    function buildPage() {
    var viewport = new Ext.Viewport({
      title: 'Main App',
      layout: 'border',
       items: [{
          title: 'Main Content',
          region: 'center',
          margins: '5 5 0 0',
          width: 400,
          autoLoad: {url: 'content.jsp'}
       }]});
    }
    Ext.onReady(buildPage);
    now to content.jsp

    HTML Code:
    <head>
    <script src="/js/extjs/adapter/ext/ext-base.js"></script>
    <script src="/js/extjs/ext-all.js"></script>
    <script src="/js/content.js"></script>
    <link rel="stylesheet" type="text/css" href="/resources/css/ext-all.css">
    </head>
    now content.js

    Code:
    buildContent= function(){
            return [
                new Ext.Panel({
                title: 'Panel 1',
                collapsible:true,
                renderTo: document.body,
                width:200,
                })
            ];
    }
    
    Ext.onReady(buildContent);
    Basically im trying to load the contents of content.jsp in the center panel...
    This doesn't seem to work...
    Am I missing something here...
    Any help would be appreciated..

    Thanks in Advance..
    Prabhu

  2. #2
    Ext User ppolyzos's Avatar
    Join Date
    Jul 2007
    Posts
    56
    Vote Rating
    1
    ppolyzos is on a distinguished road

      0  

    Default


    Maybe you typed it incorrectly.
    It is autoLoad not autoload

  3. #3
    Ext User
    Join Date
    Nov 2007
    Posts
    6
    Vote Rating
    0
    prabhupb is on a distinguished road

      0  

    Default


    Quote Originally Posted by ppolyzos View Post
    Maybe you typed it incorrectly.
    It is autoLoad not autoload
    sorry... it was a typo.
    It is infact autoLoad... (updated)

  4. #4
    Ext User ppolyzos's Avatar
    Join Date
    Jul 2007
    Posts
    56
    Vote Rating
    1
    ppolyzos is on a distinguished road

      0  

    Default


    Here is a code to display the contents of a jsp file in a panel.

    PHP Code:
    function createCompanyMoreInfoWindow(chamberIDcompanyID){
        
    //Display Panel Info about company
        
    var panelInfo = new Ext.Panel({
            
    framefalse,
            
    borderfalse,
            
    autoLoad: {
                
    url'businessDetails.jsp',
                
    params'chamber=' chamberID '&id=' companyID,
                
    scriptstrue
            
    }
        });
        
        
    //Display window
        
    var win = new Ext.Window({
            
    title'Περισσότερες Πληροφορίες',
            
    closabletrue,
            
    plaintrue,
            
    modaltrue,
            
    width700,
            
    height500,
            
    iconCls'information',
            
    layout'fit',
            
    items: [panelInfo]
        });
        
    win.show();
    }; 
    The scritps tag is used in order to enable scripts in the included page

  5. #5
    Ext User
    Join Date
    Nov 2007
    Posts
    6
    Vote Rating
    0
    prabhupb is on a distinguished road

      0  

    Default


    ppolyzos:
    Thanks a lot for the code.

    But the problem is that when the jsp contains javascript to create the extjs components then it is not viewable. It works fine for html content within jsp.

    In my case when i try to include content.jsp in the center panel it doesn't work.
    But when i access the content.jsp directly through the url it works.

    Any idea why this happens???


  6. #6
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    2
    tryanDLS is on a distinguished road

      0  

    Default


    This has been covered many times. The content you return should be a html fragment, not a full document. You also don't need to reload the Ext code in the content you're loading. The content you're loading should not be in an onReady block - it's evaled and not executed til it's done.

  7. #7
    Sencha User
    Join Date
    Aug 2011
    Posts
    2
    Vote Rating
    0
    RonyChan is on a distinguished road

      0  

    Default


    this is my code:

    function openMannager(url){
    var mbody=Ext.getCmp('mainPanel').body;
    mbody.update('').setStyle('background', '#fff');
    var newPanel=Ext.create('Ext.Panel',{
    region:'center',
    width:'100%',
    height:'100%',
    layout:'fit',
    autoLoad:{
    url: url,
    scripts: true
    }
    });
    Ext.getCmp('mainPanel').add(newPanel);
    }

    var newPanel=Ext.create('Ext.Panel',{
    region:'center',
    width:'100%',
    height:'100%',
    layout:'fit',
    autoLoad:{
    url: url,
    scripts: true
    }
    });
    it can't work.and message:uncaught exception: Cannot create an instance of unrecognized alias: widget.searchfield
    How can i load a jsp page into panel?
    thanks

  8. #8
    Sencha User
    Join Date
    Sep 2012
    Posts
    8
    Vote Rating
    0
    madhav.msd is on a distinguished road

      0  

    Default


    Hello prabhupb,

    Have you found solution for your requirement. I'm also facing the same issue, please let me know if you have solution for this. I'm using extjs 4.1.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