Welcome Guest Search | Active Topics | Sign In | Register

ModalPopupBehavior JS crashing after eo_Callback [URGENT] Options
Christiano
Posted: Thursday, January 8, 2009 8:40:17 AM
Rank: Advanced Member
Groups: Member

Joined: 11/12/2008
Posts: 42
Hi...

i'm triggering a callback with JS to refresh a Grid with this code

Code: JavaScript
function Alterar() 
        {
            var cmb = document.getElementById("<%=cmbCP.ClientID%>");
            var clpr = cmb.options[cmb.selectedIndex].value;
            if (typeof clpr == "undefined")
            {   
                alert ("Selecione um Cliente Principal\n");
                return;
            } 
            
            var grd = <%=grVeic.ClientID%>
            var item = grd.getSelectedItem();
            if (typeof item == "object") 
            {
                var placa = item.getCell(4).getValue(); 
                var vid = item.getKey();           
                showPopWin('/Modal/mod_cadVeic_1.aspx?modo=alterar&placa='+placa+'&clpr='+clpr+'&vid='+vid,750,500, rtn, true);            
            } 
            else
            {
                alert("Selecione um motorista");
            }
        }
        
        
        function rtn(returnVal) 
        {
            if (returnVal==true) {
                eo_Callback('CallbackPanel1','updGrid');
                return true;
            }
        }


Basically, it gets the value from an ASP DropDownList, a Cell Value and Row Key from the Grid and launches and JS popup...

this pop up, when it closes, returns a value to the "rtn()" function... Until here is everything working fine... Tested it with and without all possible options... The problem is not here.

when the popup returns true, and JS executes the eo_Callback (which fires an Server Side Event), everything runs well, except that when the page unloads, and js exception is raised.

this error affects an ASCX, which was there the whole time, and nothing never happened...

It says that "Run-time erro of Microsoft JScript: 'this._backgroundElement.style' is null or not an object"; and points into a line inside the AJAX Toolkit ModalPopupExtender.

Tried replacing all the UpdatePanels by CallBackPanel in the ASCX, but it only works when I comment the eo_Callback...

any idea of what is going on??
eo_support
Posted: Thursday, January 8, 2009 8:57:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

This may be normal. The first step eo_Callback does is to destroy all DHTML elements that is within its boundary. It then gets the new HTML from the server and replaces its contents with the new HTML. This causes all DHTML elements in the original contents permanently gone. Even though the new contents are visually identical, they are now different objects. Any code that still keeps a reference of the previous object will stop function. In this case you should try to adjust your code structure, so that the affected block does not rely on an element that eo_Callback will destroy; or the control is AJAX aware and it knows how to re-hookup with the new elements. In your case, you can try to exclusively use UpdatePanel since it provides similar functionalities and is natively recognized by ModalPopupExtender.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.