PDA

View Full Version : [CLOSED] MessageBox bug



Akpenob
Aug 29, 2013, 12:49 PM
Hello support

i think you have a but in the MessageBox..

When you try to show a messagebox with the handler set it throws an error



MessageBoxConfig mgsConf = new MessageBoxConfig()
{
Message = String.Format("<b>Status:</b></br><div>succeded:{0}<br>failed:{1}</div>{2}", success.Count, failures.Count, failureText),
Modal = true,
HeaderIcon = Ext.Net.Icon.EmailGo,
Buttons = MessageBox.Button.OK,
Title = "Message sendt"
};
mgsConf.Handler = @"function(){LIA.Window.Close(#{" + LiaWcf.ContainerID + "}); var bus = Ext.net.Bus; bus.publish('UpdateMessage');}"; //<---- this is the course for the error
Ext.Net.X.MessageBox.Show(mgsConf);


the error i get is this:

{"success":false,"message":"Error during ClientConfig initialization. FnProxy - Object reference not set to an instance of an object.","errors":[],"values":[]}

any idea on what goes wrong

Regards

Akpenob

Daniil
Aug 29, 2013, 1:54 PM
Hi @Akpenob,

I cannot reproduce with Ext.NET from the SVN trunk and this test case.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Alert(object sender, DirectEventArgs e)
{
MessageBoxConfig mgsConf = new MessageBoxConfig()
{
Message = "message",
HeaderIcon = Ext.Net.Icon.EmailGo,
Buttons = MessageBox.Button.OK,
Title = "Title"
};
mgsConf.Handler = @"function(){ alert('Closed'); }";
Ext.Net.X.MessageBox.Show(mgsConf);
}
</script>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Button runat="server" Text="Alert" OnDirectClick="Alert" />
</form>
</body>
</html>