PDA

View Full Version : DeferredRender:false hiding the TabPanel content on a second call. Is it a bug?



Rammynampati
5 Sep 2009, 12:11 AM
Hi Guys,
DeferredRender : false makes the content of a TabPanel to be in hidemode on a second call . Have you ever experienced it. Share with me Please.

Rammynampati
5 Sep 2009, 4:38 AM
Hurray,
This thread is creating a record by getting 22 views without a single reply. No one bothered about this.

Condor
5 Sep 2009, 7:19 AM
Have you tried adding defaults:{hideMode:'offsets'} to the tabpanel config?

Rammynampati
5 Sep 2009, 7:41 AM
Thanks for your reply condor, I am actually off the day. I try it on monday and let you know.

Rammynampati
6 Sep 2009, 9:22 PM
Hi Condor,
No gain using that..I feel it's pretty tricky that "Its the same functionality of the API documentation". The problem is i am not getting the source for API Structure any where. If anyone have any idea on this type of structure then you can surely help me here.
Please send me the code or idea how to achieve this.
Thanks,
MSR

Rammynampati
6 Sep 2009, 9:36 PM
Hi,
One thing i observed is i am using "defferredRender : false" why because i am using grids in most of my tabs and i don't want them to reload every time i call them. What i am saying is this functionality works fine for static data inside tabpanels. But i need it to be worked for GridPanels inside tabPanels.

Thanks,
MSR

Condor
6 Sep 2009, 9:40 PM
It's not completely clear what you are trying to do here from the code fragments you posted.

The thing that worries me most is the use of:

var um = newTab.getUpdater();
if(um) um.refresh();

You should only use this for loading plain HTML. If you are loading Ext components you should use LiteRemoteComponent (http://www.extjs.com/forum/showthread.php?t=18023) (or something similar) instead.

Rammynampati
6 Sep 2009, 11:15 PM
Hi Condor,
You no need to fear about that as i got "um.refresh()" from one of the forums. But removing that doesn't do any harm. If you didn't get the idea what i am doing, i explain you.
I am creating a TreePanel with leaves as west side. I created a CentralContainer as a TabPanel and adding the panels to it whenever i click on a leaf of the tree and based on the tree attributes(id).
I am sorry to say i never used plugins and i don't know whether my application supports for plugins.Can you have any other idea. You can find the images i attached for better clarification.

Thanks,
MSR

tubamanu
6 Sep 2009, 11:39 PM
i was having the same problem as descriped here, with my tabpanel and my navigation on region west. but my time was running out to find a good working solution, i ve done something on my own.
The src is added as attachment, you need to modify index.php......i just copied it out of my project, and only did some modifications ( on firebiug an error appears ) but it works on FF 3.5.......

cheers!

16093

Rammynampati
7 Sep 2009, 1:18 AM
Hi tabunamu,
Thanks a lot for the help. I analyzed your code. I am confused at this part of the code. Can you give what are you doing in this. Also you said you had the same problem as mine. What type of problem you were having ?



if(cf.TabPanel.theTabPanel.items.length > 0) {
if (windowObject.isInitialized == false) {
windowObject.init();
cf.TabPanel.theTabPanel.add(windowObject.getInstance());
cf.TabPanel.theTabPanel.setActiveTab(windowObject.getInstance());
}
else {
var windowLabel = windowObject.getInstance();
var tab = cf.TabPanel.theTabPanel.findById(windowLabel.id);
if(tab == null) {
windowObject.setInitialized(false);
windowObject.init();
cf.TabPanel.theTabPanel.add(windowObject.getInstance());
cf.TabPanel.theTabPanel.setActiveTab(windowObject.getInstance());
cf.TabPanel.theTabPanel.doLayout();
}
else {
cf.TabPanel.theTabPanel.setActiveTab(windowObject.getInstance());
}
}
}
else {
cf.Layout.theRegionCenter.remove(cf.TabPanel.theTabPanel);
cf.TabPanel.setInitialized(false);
cf.TabPanel.init();
windowObject.setInitialized(false);
windowObject.init();
cf.TabPanel.theTabPanel.add(windowObject.getInstance());
cf.Layout.theRegionCenter.add(cf.TabPanel.theTabPanel);
cf.Layout.theRegionCenter.doLayout();
}




Great appreciation for your help.
Thanks,
MSR

tubamanu
7 Sep 2009, 1:57 AM
my problem was, that a tab on my tabpanel is displayed one time correct. after removing the tab from my tabpanel, i want to add it again, only the tab-title is displayed, but not the content. think this is the same problem seen in your second screenshot. also was a problem, if my tabpanel was empty, no tabs could be added. but i did not found and get any help and my time was running out, so added this code:




// here i am checking if my tabpanel has already some tabs opened
if(cf.TabPanel.theTabPanel.items.length > 0) {
// here i check if my tab i want to open is already initialized, if not,
// create instance and add to tabpanel
if (windowObject.isInitialized == false) {
windowObject.init();
cf.TabPanel.theTabPanel.add(windowObject.getInstance());
cf.TabPanel.theTabPanel.setActiveTab(windowObject.getInstance());
}
else {
// if my tab is already initialzied......
var windowLabel = windowObject.getInstance();
// here i check, if my initialized tab is on my tabpanel or not
var tab = cf.TabPanel.theTabPanel.findById(windowLabel.id);
// tab here is not in tabpanel
if(tab == null) {
// create new instance of my tabitem and add it to tabpanel
windowObject.setInitialized(false);
windowObject.init();
cf.TabPanel.theTabPanel.add(windowObject.getInstance());
cf.TabPanel.theTabPanel.setActiveTab(windowObject.getInstance());
cf.TabPanel.theTabPanel.doLayout();
}
// tabitem is already exiting in tabpanel, i set focus to it
else {
cf.TabPanel.theTabPanel.setActiveTab(windowObject.getInstance());
}
}
}
// here my tabpanel has 0 items. i reinitalize it, and add my tab item...
else {
cf.Layout.theRegionCenter.remove(cf.TabPanel.theTabPanel);
cf.TabPanel.setInitialized(false);
cf.TabPanel.init();
windowObject.setInitialized(false);
windowObject.init();
cf.TabPanel.theTabPanel.add(windowObject.getInstance());
cf.Layout.theRegionCenter.add(cf.TabPanel.theTabPanel);
cf.Layout.theRegionCenter.doLayout();
}

tubamanu
7 Sep 2009, 2:01 AM
summarized again, in some kind of pseude code explains it better:


if( tabpanel has items ) {

if(tabitem is already initialized) {
here tabitem is initialized, but maybe it is not visible in the panel
if (tabitem is not in tabpanel) {
creeate new instance
}
else (tabitem is tabpanel) {
set focus
}

}
else (tab item has never been initialized){
create instance and add to tabpanel
}


}
else (tabpanel has 0 items) {
initialize Tabpanel
add the tabitem u clicked on
}

Animal
7 Sep 2009, 2:23 AM
Your problem is here:



cf.Layout.theRegionCenter.remove(cf.TabPanel.theTabPanel);


Read the Container.remove documentation.

Rammynampati
7 Sep 2009, 4:19 AM
@ tubamanu
The problem you faced is different from mine. I can open tabs after closing them because i am creating new instance on each call and for the object give a unique id. Why are you doing so much validation? Just create and add it .




var tabPanel = Ext.getCmp('center-container'); //this is the my container contains tab panels your case "cf.TabPanel"
if(node.attributes.id == 'Calendar'){
var calendarContainer = new nsi.ct.web.ui.calendar.CalendarContainer({title: 'Calendar',context: that});//creating a new instance everytime i call the node
tabPanel.add(calendarContainer).show(); //adding it to the base tabpanel
tabPanel.setActiveTab(calendarContainer);
tabPanel.doLayout();
And also to open a new window you can override it as



nsi.ct.web.ui.order.AddNewOrder = Ext.extend(Ext.Window,{
initComponent : function() {
Ext.apply(this,{

//border:false,
bodyStyle:'padding:10px 15px 10px',
closeAction:'hide',
items : {}
});
}
Cheers,
MSR

Rammynampati
7 Sep 2009, 6:35 AM
Hi All,
Does anyone have worked on a model like "API Documentation", can surely give the right solution. I am almost there with the only bug. Its really making me frustrate that it doesn't happen ever. Any more suggestions Please.

tubamanu
7 Sep 2009, 8:59 AM
i did not get it worked, and needed to get a quick solution...
can u add your project ? or a live demo ?

Rammynampati
7 Sep 2009, 9:35 PM
Hi Tubamanu,
Can you be more specific where you got struck?

Rammynampati
7 Sep 2009, 9:41 PM
Hi Guys,
Have you ever know how the "API Documentation" model is build on. If yes can you share that with me. I am struggling with a bug which i explained in the first post.

tubamanu
7 Sep 2009, 10:32 PM
i was using a viewport with west and center region. on west navigation ( now accordion, two weeks ago , a tree ) and in center region a tabpanel.

my problem was, that i can open a tab only one time. after closing and re-opening the tab, it only the tab in the tabpanel is shown but not its content. also there was a problem, when the tabpanel had no tabs left. then i could not add tabs to my tabpanel. also i needed that active tab gets focus when it is already opened and clicked on navigation.
actually for my project it is working, but as i read, there are some better solutions for this ;-)

Rammynampati
9 Sep 2009, 1:59 AM
if(node.attributes.id == 'Calendar'){
if(Ext.getCmp('calendar-container'))
{
tabPanel.setActiveTab('calendar-container');
}
else
{
var calendarContainer = new nsi.ct.web.ui.calendar.CalendarContainer({title: 'Calendar',context: that});
tabPanel.add(calendarContainer).show();
tabPanel.doLayout();
}
}


Friends Thanks for all your support. Here is the solution.First time i call i am calling with a new instance but second time onwards i just setting it as active tab.