Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by k on May 13, 2008 08:07
open dhtmlx forum
tabbar forceload


I'm having issue in forcing a tabbar to refresh whenever it is clicked!
I used the following code:

 function initTabs(){
                    tabbar=new dhtmlXTabBar('a_tabbar','top');
                  tabbar.setImagePath('images/imgs/');
                  tabbar.preventIECashing(true);
                  tabbar.setHrefMode('iframes-on-demand');
                  tabbar.setSkinColors('#FCFBFC','#F4F3EE');
                  tabbar.setStyle('modern');
                  tabbar.enableAutoSize(true,true);
                 
                  tabbar.setMargin(-1);

                  tabbar.loadXML('menu.xml');
                 
                  tabbar.setOnSelectHandler(on_select_handler(idn, ido){
                      tabbar.forceLoad(idn);   
                      return true;
                  });
              }

With the setOnSelectHandler function, my tabbars wont activate anymore, neither can i access any of them. I get the following JS error:
'this._lastActive.idd is null or not an object'
There was a similar issue regarding that same error and a new .js file was provided. But that too failed me. Also my issue is slightly different since tabs cant be used/selected at all!

Please help me out to resolve this issue. Or maybe provide me some sample code that will force refresh a tab upon clicking it (the tab loads a JSP page which has dynamic content from a db)
Answer posted by Support on May 13, 2008 09:22
You are using incorrect syntax in your js code ( at least it not works in my case )
The correct code will be

                  tabbar.setOnSelectHandler(function(idn, ido){
                      tabbar.forceLoad(idn);   
                      return true;
                  });
Answer posted by Support on May 14, 2008 08:29
Also , if you just need default tab value, you need not call the forceLoad method - it will be done automatically, the main purpose of this function - reload tab content with new value when necessary