Welcome Guest Search | Active Topics | Sign In | Register

CallbackPanel crashes on Second Refresh Options
John
Posted: Tuesday, April 15, 2014 12:53:16 PM
Rank: Member
Groups: Member

Joined: 6/12/2013
Posts: 13
I have a Callback Panel on an ASP.Net page that contains a Literal control. The page loads fine, and I can execute the callback successfully once, but for some reason on the second time a JavaScript error is thrown and you cannot run the callback after that. This isn't a publicly accessed page but I'll try to post as much of it as I can here. I'm working with EO.Web.dll version 11.0.49.2.

ERROR:
Unhandled exception at line 6, column 9537 in http://localhost:62738/eo_web.ashx?id=492ae872-49fe-4aa5-8344-a89683bc3b1a

0x800a138f - JavaScript runtime error: Unable to set property 'value' of undefined or null reference


And the highlighted line looks like...
Code: JavaScript
EO1149.g.s.__EVENTTARGET.value="";


Here are the relevant bits of code...
Code: HTML/ASPX
<eo:CallbackPanel runat="server" ID="cbpScript">
        <asp:Literal runat="server" ID="litJSONData"></asp:Literal>
</eo:CallbackPanel>


Code: JavaScript
function loadView(tf) {
     eo_Callback(cbpScript_ci, 'LOAD@' + $("#hidTimeFrame").val() + '@' + tf + '@' + $("#ddlProp").val());
};


Code: Visual Basic.NET
Private Sub cbpScript_Execute(sender As Object, e As EO.Web.CallbackEventArgs) Handles cbpScript.Execute
     Try
          Select Case UCase(e.Parameter.Split("@")(0))
               Case "LOAD"
                    Dim tf As New Date(CInt(e.Parameter.Split("@")(1).Split("/")(1)), CInt(e.Parameter.Split("@")(1).Split("/")(0)), 1)
                    tf = tf.AddMonths(e.Parameter.Split("@")(2))
                    Dim jobid As Integer = CInt(e.Parameter.Split("@")(3))
                    BuildJSONData(tf, jobid)
                End Select

          litJSONData.Text &= "<script type=""text/javascript"">loadForm();</script>"
    Catch ex As Exception
         Greystar.Core.Logging.LogController.SaveLog(AppGlobal.AppName, Greystar.Core.Logging.LogTypes.ApplicationError, ex.ToString, "Draw.aspx.vb - cbpScript_Execute", Session("associateid"), Session("userid"))
    End Try
End Sub


Any help or insight you can throw at me would be greatly appreciated.
eo_support
Posted: Wednesday, April 16, 2014 4:16:40 PM
Rank: Administration
Groups: Administration

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

Your code looks fine to us. The problem that you are running into indicates that the form's __EVENTTARGET variable is gone. Which should not happen for an ASP.NET page but it's possible to make it happen with JavaScript. Below is an extreme example of how this can happen:

Code: JavaScript
//Get the form element
var form = document.getElementById("form1");

//Clear everything inside the form
form.innerHTML = "";


The above code will clear everything inside the form and cause our code to fail. So you might want to check whether you have similar code on your end.

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.