PDA

View Full Version : extjs panel silverlight unloads



dorj
15 Jun 2011, 9:25 AM
Hi,
I have a silverlight control loaded in a tabpanel of extjs. On changing the state of silverlight grid for e.g clicking a radio button and then going to some other tabpanel, the silverlight control unloads, it hits application_exit while debugging. If i dont change the state and click away to other panel, silverlight control does not unload.

Would appreciate if any one knows about this and has a fix.

Thanks,

This is how i call Silverlight control.


function CreateSilverlightObject(params) {

paramValues = params;
var div = document.createElement("div");
div.setAttribute("id", "silver_div");
document.body.appendChild(div);
Silverlight.createObjectEx({
source: "ClientBin/Dashboard.xap",
parentElement: div,
id: "SilverlightControl_1",
properties: {
width: "100%",
height: "100%",
version: "1.1",
enableHtmlAccess: "true",
isWindowless: 'True',
background: 'transparent'
},
events: {
onLoad: onSLLoad,
onError: onSilverlightError
}//, initParams: "params=" + params
});
return div.getAttribute("id");
}

skirtle
15 Jun 2011, 4:25 PM
Never used Silverlight but have seen similar things with Flash and Applets. Have you tried changing the hideMode on the panel that is being used as a tab? When you change between tabs it hides the previous tab and for some embedded objects this causes them to exit and reload in some browsers. Changing the hideMode to offsets can sometimes help but you need to be careful to ensure you put it on the right component (annoyingly it isn't something you can just write into your Flash/Applet/Silverlight wrapper component, you're at the mercy of a correctly configured container further up the chain).

amanind
16 Jun 2011, 11:01 PM
Hi Skirtle,

I dont think "offset" is any value for hidemode, either it is true or false

skirtle
17 Jun 2011, 5:38 AM
From the docs:


hideMode : String
How this component should be hidden. Supported values are 'visibility' (css visibility), 'offsets' (negative offset position) and 'display' (css display).

Note: the default of 'display' is generally preferred since items are automatically laid out when they are first shown (no sizing is done while hidden).

The only correction I would make to my earlier post is that you might also like to try a hideMode of visibility. In some experiments I was doing with Flash yesterday I found that offsets fixed problems for Chrome but not Firefox, whereas visibility seemed to work for both. In that case I was working with a collapsible panel and I also needed to set animCollapse: false but that shouldn't be relevant for tabs.