Login Register

Page loading with ContentPane href loading twice

Hi ,

I am dynamically loading the page with setting href while creating the content pane. When I am adding the loaded page to the PageContainer as a child the page is loading again.

This repeated loading causes the problem for me.

contentPane = dojo.widget.createWidget("ContentPane",{widgetId:this.name,href:this.url,cacheContent:false,executeScripts:true,scriptSeparation:false});

this.contentPane.addOnLoad(window,addOnLoadFunction);

if(contentPane){ pageContainer.addChild(contentPane); }

Please help me.

-Raj

Is your pageContainer set to

Is your pageContainer set to refreshOnShow? If so, when you addChild is your contentPane being displayed immediately? Problem sounds more like with PageContainer than ContentPane, can you show us either a working test page or the full src code for your JS? (including the parameters you are using with your PageContainer)

-Karl

Is your pageContainer set to

Is your pageContainer set to refreshOnShow?
NO
If so, when you addChild is your contentPane being displayed immediately?
YES, I observed, while creating the contentpane first request is done(got page response data) but not showing the page and after adding content pane to page container, second request is
made and after getting response it showing the page.

Page container is : div dojoType="PageContainer" widgetId = "CartPages" >

I am calling pageContainer.selectChild(pageName,undefined) to show the page by calling this line of code in the loading page addOnLoad function.

I am not using any extra parameters.

Thanks,
Raj.

Try...

var srcNode = document.createElement('div');
srcNode.style.display = 'none';
contentPane = dojo.widget.createWidget("ContentPane",{widgetId:this.name,href:this.url,cacheContent:false,executeScripts:true,scriptSeparation:false}, srcNode);
-Karl

 HI Karl, Thanks for quick

 HI Karl,

Thanks for quick response/support,

I added the code and while adding the content pane to page container it is sending request and loading.

It is working fine(sending request once) for first page loading but for loading second page on top of the first one , it is not even sending the single request. It is creating <div style="display: none; position: relative;" dojoinsertionindex="1"/> and ends.

Thanks,
Raj.

Can you put up a live link

Can you put up a live link to show this? display:none will delay the loading until the contentPane is displayed.... are you sure that isnt what is happening on the 2nd one? I'm leaving my desk shortly, so I wont be able to reply for a few hours.

-Karl

SOLVED

Hi Karl,

Finally I found the solution after debugging the code(Thanks to firebug).

1. While creating the content pane with href a request is being sent
2. Immediately I am adding the same content pane to the page container. Page container is trying to test the Contentpane.isLoaded and trying to load it again( it is false, since the request is not fulfilled yet).

I added contentpane.isLoaded = true before adding that to pagecontainer, nothing is modified other than this.

Once again Thank you Karl for you cooperation.

Thanks,
RajendarM