1. #1
    Sencha User
    Join Date
    Feb 2009
    Posts
    326
    Vote Rating
    0
    joefox is on a distinguished road

      0  

    Default Error Rendering Button - Refresh No Error

    Error Rendering Button - Refresh No Error


    I have a few buttons that are created by javascript, i get an error when i first go to my page, then i hit refresh and the error is gone, and my buttons get rendered, any ideas?

    So what i did is create a function to run after all my html is rendered, since my div's wont be on the page until its all the way done.

    so i run Config_buttons() at the end of my html, and it should find the buttons, coudl this be my problem?


    Code:
    function Config_Buttons()
    {
     //Code For Drop Down Box For Selection Of Group Type
     var converted2 = new Ext.form.ComboBox({
     typeAhead: true,
     triggerAction: 'all',
     transform:'Search_ADtype',
     width:130,
     forceSelection:true
     });
     
     //Rerender Update Search By User Config Button
     new Ext.Button({
            text: 'Update Search Attribute',
            handler: Update_Search_User_Field
        }).render(document.body, 'config_update_search_user_button');
     
     //Rerender Search User Button
     new Ext.Button({
            text: 'Search',
            handler: SearchUsers
        }).render(document.body, 'user_search_button');
     
    }
    Here is error:


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

      0  

    Default


    Post code, we can't guess.

  3. #3
    Sencha User
    Join Date
    Feb 2009
    Posts
    326
    Vote Rating
    0
    joefox is on a distinguished road

      0  

    Default


    So maybe i am doing this wrong.

    I keep thinking that i have to have the <div> on the page before i run the javascript, or does the render happen after the html to the page has been written?

    *********EDIT*****************

    So i tried to put the info in the button rewrites, and it still dosent work.

    If i remove all my button rendering, and my select rendering, it works no problem.


    So i double checked, and it is my redering of buttons, i tried to remove a button render at a time, and it keeps throwing same error.

    However, like i said when i hit refresh on page, all buttons are rendered, and no errors.

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

      0  

    Default


    What happens when you do this in Firefox with Firebug? You should be able to set a breakpont there, or break on all errors. It's pointless to try and debug in IE with no tools.

    Is this code in an Ext.onReady block?

  5. #5
    Sencha User
    Join Date
    Feb 2009
    Posts
    326
    Vote Rating
    0
    joefox is on a distinguished road

      0  

    Default


    Quote Originally Posted by tryanDLS View Post
    What happens when you do this in Firefox with Firebug? You should be able to set a breakpont there, or break on all errors. It's pointless to try and debug in IE with no tools.

    Is this code in an Ext.onReady block?

    No its not in the Ext.onReady block, so i just added that, and it throws more errors.

    Code:
    //Config and Render Buttons
    function Config_Buttons()
    {
    Ext.onReady(function(){
    Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
     
     //Code For Drop Down Box For Selection Of Group Type
     var converted2 = new Ext.form.ComboBox({
     typeAhead: true,
     triggerAction: 'all',
     transform:'Search_ADtype',
     width:130,
     forceSelection:true
     });
      
     //Rerender Update Search By User Config Button
     new Ext.Button({
            text: 'Update Search Attribute',
            handler: Update_Search_User_Field
        }).render(document.body, 'config_update_search_user_button');
     
     //Rerender Search User Button
     new Ext.Button({
            text: 'Search',
            handler: SearchUsers
        }).render(document.body, 'user_search_button');
     }
     
    }

  6. #6
    Sencha User
    Join Date
    Feb 2009
    Posts
    326
    Vote Rating
    0
    joefox is on a distinguished road

      0  

    Default


    anyone?

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

      0  

    Default


    You really need to go back and look at how the examples are structured and the tutorials. Nowhere will you see code structured like that. Ext.onReady wraps all the code that needs wait for the dom to be fully loaded - it doesn't go inside another global function.

    'Throws more errors' doesn't give us any info to help you. Build a simple html page that illustrates this and post that - you are obviously missing something, but we're shooting in the dark with the info you've provided.

  8. #8
    Sencha User
    Join Date
    Feb 2009
    Posts
    326
    Vote Rating
    0
    joefox is on a distinguished road

      0  

    Default


    Quote Originally Posted by tryanDLS View Post
    You really need to go back and look at how the examples are structured and the tutorials. Nowhere will you see code structured like that. Ext.onReady wraps all the code that needs wait for the dom to be fully loaded - it doesn't go inside another global function.

    'Throws more errors' doesn't give us any info to help you. Build a simple html page that illustrates this and post that - you are obviously missing something, but we're shooting in the dark with the info you've provided.

    What i do is create my page, which has ajax function at the end of the dom, to fill in certain parts of the page's.

    Then at the end of my html on my main page, i run a few functions, 1 of those is rerendering the buttons that were pulled in via my ajax pages.

    Again, this works when i hit refresh, but wont work when i first go to the page.

  9. #9
    Sencha User
    Join Date
    Feb 2009
    Posts
    326
    Vote Rating
    0
    joefox is on a distinguished road

      0  

    Default


    Ok so I added in button rendering and it still throws the same error.

    Code:
     Ext.onReady(function(){
        Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
            
           var viewport = new Ext.Viewport({
                layout:'border',
                items:[
                    new Ext.BoxComponent({ // raw
                        region:'north',
                        el: 'header',
                        height:32
                    }),{
                        region:'south',
                        contentEl: 'log',
                        split:true,
         autoScroll:true, // Allow Scrolling
                        height: 100,
                        minSize: 100,
                        maxSize: 200,
                        collapsible: true,
                        title:'Event Log',
         iconCls:'nav',
                        margins:'0 0 0 0'
                    },{
                        region:'west',
                        id:'west-panel',
                        title:'Main Menu',
                        split:true,
                        width: 250,
                        minSize: 175,
                        maxSize: 400,
                        collapsible: true,
                        margins:'0 0 0 5',
                        layout:'accordion',
                        layoutConfig:{
                            animate:true
                        },
                        items: [{
                            contentEl: 'search',
                            title:'Search',
                            border:false,
          autoScroll:true, // Allow Scrolling
                            iconCls:'nav'
                        },{
          contentEl: 'config',
                            title:'Config Information',
                            border:false,
          autoScroll:true, // Allow Scrolling
                            iconCls:'settings'
                        },{
          contentEl: 'yourinformation',
                            title:'Your Information',
                            border:false,
          autoScroll:true, // Allow Scrolling
                            iconCls:'settings'
                        }]
                    },
         new Ext.TabPanel({
          region:'center',
          deferredRender:false,
          activeTab:0,
          items:[{
           contentEl:'disclamer',
           title: 'Use Policy',
           closable:true,
           autoScroll:true
          },{
           contentEl:'center2',
           title: 'User Information',
           autoScroll:true
          },{
           layout: 'accordion',
           title: 'Config Options',
           items:[{
            contentEl: 'User_Search_Attribute',
            title: 'User Search Attribute Option',
            iconCls:'settings'
           },{
            title: 'Application User Policy',
            contentEl: 'Application_Use_Policy',
            iconCls:'settings'
           }]
          },{
           contentEl:'Reporting',
           title: 'Reporting',
           autoScroll:true
          },{
           contentEl:'Action_Log',
           title: 'Action Log',
           autoScroll:true
          }]
         })
                 ]
      
            });
        
         //Code For Drop Down Box For Selection Of Group Type
     var converted2 = new Ext.form.ComboBox({
     typeAhead: true,
     triggerAction: 'all',
     transform:'Search_ADtype',
     width:130,
     forceSelection:true
     });
      
     //Rerender Update Search By User Config Button
     new Ext.Button({
            text: 'Update Search Attribute',
            handler: Update_Search_User_Field
        }).render(document.body, 'config_update_search_user_button');
     
     //Rerender Search User Button
     new Ext.Button({
            text: 'Search',
            handler: SearchUsers
        }).render(document.body, 'user_search_button');
        
        });

  10. #10
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Post a working showcase, and please do as Tim suggested use firebug to report errors.

    http://extjs.com/learn/Ext_Forum_Hel...rking_showcase