PDA

View Full Version : ContentPanel SetUrl Problem



janixams
29 May 2008, 1:06 PM
Hi all.
I have a treepanel in the west layout region and when the user select a node, I call a function that should to change the content of a contentPanel in the center region. I use the setUrl() method to load a HTML page, but the load icon never stop and the content is not loaded.
The problem is:
How can I include an HTML page into contentPanel?

Some of code here:


myTree.on('click', function (){
cargar_contenido_tabs();
})


function cargar_contenido_tabs(){
layout.findPanel('descripcion').getUpdateManager().loadScripts = true;
layout.findPanel('descripcion').setUrl({url:'http://ejemplo.cdr.xx', text:'cargando...'}, null, true);
layout.findPanel('descripcion').refresh();
};
And, Firebug shows this error:
[Exception... "'Permission denied to call method XMLHttpRequest.open' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]

Any idea?
Thanks in advance.

janixams
31 May 2008, 6:36 PM
The problem has been fixed. I had the wrong URL.
Thanks any way. ;)

Here is the code, maybe somebody need it at any time.


layout.getRegion('center').getTabs().getTab('descripcion').getUpdateManager().loadScripts = true;
layout.getRegion('center').getPanel('descripcion').load({url: './JavaScript/anexos/proy_descrip.php', text:'Cargando...'});
layout.getRegion('center').getPanel('descripcion').refresh();


Remember that panel.load() loads the content in this content panel immediately, if you need to set the content when the panel is activated, you must to use setUrl().

I hope that this helps you.