Mar 27, 2014, 1:23 PM
[CLOSED] Close window issue since getting latest SVN
Hi guys,
Since getting latest SVN this morning, when I close a window after I've completed action (filled fields etc), I get :-
Unhandled exception at line 18, column 807655 in http://localhost:58966/extjs/ext-all-js/ext.axd?v=13054
0x800a138f - JavaScript runtime error: Unable to get property 'remove' of undefined or null reference
The cshtml of this window has not changed between yesterday and today, only the Ext.Net build. If I open and close the window without touching any of the fields it does not error.
The entire cshtml is included.
Since getting latest SVN this morning, when I close a window after I've completed action (filled fields etc), I get :-
Unhandled exception at line 18, column 807655 in http://localhost:58966/extjs/ext-all-js/ext.axd?v=13054
0x800a138f - JavaScript runtime error: Unable to get property 'remove' of undefined or null reference
The cshtml of this window has not changed between yesterday and today, only the Ext.Net build. If I open and close the window without touching any of the fields it does not error.
The entire cshtml is included.
@using CAMS.NLS.Resources
@using CAMS.Web.UI.ViewModels;
<script>
var fnWindowClose = function () {
/* get rid of this window */
var win = Ext.getCmp('CREATE_NEW_MESSAGE_WINDOW_ID');
win.destroy();
};
/*------------------------------------------------------------------------------------------*/
var fnMessageSendSuccess = function () {
/* indicate the success */
toastr.success('@GlobalResources.MessageSendSuccessMessage', '@GlobalResources.MessageSendSuccessTitle');
App.NEW_MESSAGE_FORM_PANEL.reset();
};
/*------------------------------------------------------------------------------------------*/
var fnMessageSendFailure = function (result) {
if (result.errorMessage !== "" && result.errorMessage.indexOf('{') === -1) {
toastr.error(result.errorMessage,
'@GlobalResources.MessageSendFailureTitle',
{ timeOut: 0, extendedTimeOut: 0 });
}
else {
/* ensure a valid JSON format */
var str = result.errorMessage.replace(/success/g, '"success"');
str = str.replace(/message/g, '"message"');
toastr.error('@GlobalResources.MessageSendFailureMessage : ' + JSON.parse(str).message,
'@GlobalResources.MessageSendFailureTitle',
{ timeOut: 0, extendedTimeOut: 0 });
}
};
/*------------------------------------------------------------------------------------------*/
var fnAdminRecipientSelected = function (item, records) {
App.RECIPIENT_ID_HIDDEN_ID.setValue(item.value);
App.RECIPIENT_TEXTFIELD_ID.setValue(item.rawValue);
};
/*------------------------------------------------------------------------------------------*/
var fnAssessorRecipientSelected = function (item, records) {
App.RECIPIENT_ID_HIDDEN_ID.setValue(item.value);
App.RECIPIENT_TEXTFIELD_ID.setValue(item.rawValue);
};
/*------------------------------------------------------------------------------------------*/
var fnUserRecipientSelected = function (item, records) {
App.RECIPIENT_ID_HIDDEN_ID.setValue(item.value);
App.RECIPIENT_TEXTFIELD_ID.setValue(item.rawValue);
};
/*------------------------------------------------------------------------------------------*/
var fnFileSelected = function (fb, v) {
if (v) {
var ctrl = Ext.getCmp('NEW_MESSAGE_ATTACHMENT_FILENAMES_ID');
if (!(typeof ctrl === "undefined")) {
ctrl.setValue(v);
}
}
};
/*------------------------------------------------------------------------------------------*/
function fnCheckDetails() {
var recipient = Ext.getCmp('RECIPIENT_TEXTFIELD_ID');
var title = Ext.getCmp('TITLE_TEXTFIELD_ID');
var message = Ext.getCmp('MESSAGE_TEXTFIELD_ID');
if (((typeof recipient !== "undefined") && (typeof recipient.value !== "undefined") && (recipient.value != "")) &&
((typeof title !== "undefined") && (typeof title.value !== "undefined") && (title.value != "")) &&
((typeof message !== "undefined") && (typeof message.value !== "undefined") && (message.value != ""))
) {
Ext.getCmp('SEND_BUTTON_ID').show();
}
else {
Ext.getCmp('SEND_BUTTON_ID').hide();
}
}
</script>
@model SendUserMessageViewModel
@{
SendUserMessageViewModel vm = Page.model;
}
@(Html.X().Window()
.ID("CREATE_NEW_MESSAGE_WINDOW_ID")
.Layout(LayoutType.Fit)
.Icon(Icon.ApplicationFormEdit)
.Title(String.Format("{0} {1} {2}", GlobalResources.Create, GlobalResources.New, GlobalResources.Message ))
.Border(false)
.Resizable(true)
.Draggable(true)
.Width(900)
.Modal(true)
.AutoScroll(true)
.BodyStyle("background-color:#ffffff;")
.Padding(10)
.UI(UI.Info)
.Listeners(ls => ls.Close.Fn = "fnWindowClose")
.Items(
Html.X().FieldSet()
.Cls("cams-fieldset atlas border2")
.Title(GlobalResources.Message)
.Layout(LayoutType.Anchor )
.AnchorHorizontal("100%")
.AnchorVertical("100%")
.Defaults(Html.X().Parameter().Name("HideEmptyLabel").Value("false").Mode(ParameterMode.Raw))
.Collapsible(false)
.Margin(10)
.Items(
Html.X().FormPanel()
.ID("NEW_MESSAGE_FORM_PANEL")
.Layout(LayoutType.HBox)
.LayoutConfig(new HBoxLayoutConfig { Align = HBoxAlign.StretchMax })
.DefaultButton("SEND_BUTTON_ID")
.Defaults(d =>
{
d.Add(new Parameter("HideEmptyLabel", "false", ParameterMode.Raw));
})
.Items(
Html.X().HiddenFor(m => Model.AttachmentFileNames)
.ID("NEW_MESSAGE_ATTACHMENT_FILENAMES_ID"),
// ------------ Recipients panel ----------------
Html.X().Panel()
.Layout(LayoutType.VBox)
.LayoutConfig(new VBoxLayoutConfig { Align = VBoxAlign.StretchMax })
.Width(350)
.Items(
Html.X().FieldSet()
.Cls("cams-fieldset atlas border1")
.Title( String.Format("{0} {1}", GlobalResources.Select, GlobalResources.Recipients))
.Layout(LayoutType.Anchor )
.AnchorHorizontal("100%")
.AnchorVertical("100%")
.Items(
Html.X().ComboBox() //For(m => Model.AdminRecipient)
.ID("RECIPIENT_ADMIN_ID")
.LabelAlign(LabelAlign.Top)
.LabelSeparator("")
.FieldLabel(GlobalResources.Administration)
.Width(250)
.DisplayField("Name")
.ValueField("UserId")
.EmptyText( GlobalResources.SelectRecipient )
.StoreID("ADMIN_RECIPIENTS_STORE_ID")
.QueryMode(DataLoadMode.Local)
.TypeAhead(true)
.Listeners(l => l.Select.Fn = "fnAdminRecipientSelected")
.Callouts(co => co.Add( Html.X().Callout()
.Width(150)
.Title("Hint")
.UI(UI.Info)
.ToolbarAlign("Right")
.Trigger(CalloutTrigger.Hover)
.Html("You can use 'type ahead' to quickly select an Administrator.")
)
),
Html.X().ComboBox() //For(m => Model.AssessorRecipient)
.ID("RECIPIENT_ASSESSOR_ID")
.LabelAlign(LabelAlign.Top)
.LabelSeparator("")
.FieldLabel( GlobalResources.Assessors)
.Width(250)
.DisplayField("Name")
.ValueField("UserId")
.EmptyText( GlobalResources.SelectRecipient )
.StoreID("ASSESSOR_RECIPIENTS_STORE_ID")
.QueryMode(DataLoadMode.Local)
.TypeAhead(true)
.Listeners(l => l.Select.Fn = "fnAssessorRecipientSelected")
.Callouts(co => co.Add( Html.X().Callout()
.Width(150)
.Title("Hint")
.UI(UI.Info)
.ToolbarAlign("Right")
.Trigger(CalloutTrigger.Hover)
.Html("You can use 'type ahead' to quickly select an Assessor.")
)
),
Html.X().ComboBox() //For(m => Model.UserRecipient)
.ID("RECIPIENT_USER_ID")
.LabelAlign(LabelAlign.Top)
.LabelSeparator("")
.FieldLabel(GlobalResources.Users)
.Width(250)
.DisplayField("Name")
.ValueField("UserId")
.EmptyText( GlobalResources.SelectRecipient )
.StoreID("USER_RECIPIENTS_STORE_ID")
.QueryMode(DataLoadMode.Local)
.TypeAhead(true)
.Listeners(l => l.Select.Fn = "fnUserRecipientSelected")
.Callouts(co => co.Add( Html.X().Callout()
.Width(150)
.Title("Hint")
.UI(UI.Info)
.ToolbarAlign("Right")
.Trigger(CalloutTrigger.Hover)
.Html("You can use 'type ahead' to quickly select a User.")
)
)
) // end of Recipients fieldset items
) // end of Recpients panel items
.Bin(
Html.X().StoreFor<RecipientInfo>()
.ID("ADMIN_RECIPIENTS_STORE_ID")
.Proxy(Html.X().AjaxProxy()
.ActionMethods(methods => methods.Read = HttpMethod.GET)
.Url(Url.RouteUrl("AlternateApi", new { httproute = "", controller = "UserApi", action = "RetrieveMessageAdminRecipients" }))
.Reader(Html.X().JsonReader().Root("Data"))
)
.AutoLoad(true),
Html.X().StoreFor<RecipientInfo>()
.ID("ASSESSOR_RECIPIENTS_STORE_ID")
.Proxy(Html.X().AjaxProxy()
.ActionMethods(methods => methods.Read = HttpMethod.GET)
.Url(Url.RouteUrl("AlternateApi", new { httproute = "", controller = "UserApi", action = "RetrieveMessageAssessorRecipients" }))
.Reader(Html.X().JsonReader().Root("Data"))
)
.AutoLoad(true),
Html.X().StoreFor<RecipientInfo>()
.ID("USER_RECIPIENTS_STORE_ID")
.Proxy(Html.X().AjaxProxy()
.ActionMethods(methods => methods.Read = HttpMethod.GET)
.Url(Url.RouteUrl("AlternateApi", new { httproute = "", controller = "UserApi", action = "RetrieveMessageUserRecipients" }))
.Reader(Html.X().JsonReader().Root("Data"))
)
.AutoLoad(true)
), // end of Recpients panel Bin items
// --------------- Message Panel ----------------------------
Html.X().Panel()
.Layout(LayoutType.Anchor)
.AnchorHorizontal("100%")
.AnchorVertical("100%")
.Width(480)
.Items(
Html.X().FieldSet()
.Cls("cams-fieldset atlas border1")
.Title( GlobalResources.Message )
.Layout(LayoutType.Anchor )
.AnchorHorizontal("100%")
.AnchorVertical("100%")
.Items(
Html.X().HiddenFor(m => Model.RecipientId)
.ID("RECIPIENT_ID_HIDDEN_ID"),
Html.X().HiddenFor(m => Model.Recipients)
.ID("RECIPIENTS_IDS_HIDDEN_ID"),
Html.X().TextField()
.ID("RECIPIENT_TEXTFIELD_ID")
.Icon(Icon.User)
.LabelSeparator("")
.LabelAlign(LabelAlign.Top)
.FieldLabel( GlobalResources.Recipient )
.Selectable(false)
.Width(450)
.EmptyText("Selected recipient will appear here")
.Listeners(l => l.Change.Fn = "fnCheckDetails"),
Html.X().Panel().MinHeight(5),
Html.X().CheckboxFor(m => Model.IsAlert)
.IndicatorIcon(Icon.Exclamation)
.IndicatorText(GlobalResources.MessageTypeIsAnAlert)
.LabelSeparator("")
.LabelAlign(LabelAlign.Top)
.Width(200)
.FieldLabel(String.Empty),
Html.X().Panel().MinHeight(5),
Html.X().TextFieldFor(m => Model.MessageTitle)
.ID("TITLE_TEXTFIELD_ID")
.Icon(Icon.Pencil)
.LabelSeparator("")
.LabelAlign(LabelAlign.Top)
.FieldLabel( GlobalResources.Title )
.AutoScroll(true)
.MinHeight(30)
.Width(450)
.EmptyText("Type your message title here")
.Listeners(l => l.Change.Fn = "fnCheckDetails"),
Html.X().Panel().MinHeight(10),
Html.X().TextAreaFor(m => Model.MessageText)
.ID("MESSAGE_TEXTFIELD_ID")
.Icon(Icon.Pencil)
.LabelSeparator("")
.LabelAlign(LabelAlign.Top)
.FieldLabel( String.Format("{0} {1}", GlobalResources.Your, GlobalResources.Message))
.AutoScroll(true)
.Width(450)
.MinHeight(150)
.EmptyText("Type your message here")
.Listeners(l => l.Change.Fn = "fnCheckDetails")
) // end Message Panel items
)
) // end of form panel NEW_MESSAGE_FORM_PANEL
.Buttons(
//Html.X().FileUploadField()
// .ID("ATTACHMENT_BUTTON_ID")
// .ButtonOnly(false)
// .Icon(Icon.EmailAttach)
// .MinWidth(350)
// .Flex(1)
// .ButtonText(String.Format("{0} {1}", GlobalResources.Add, GlobalResources.Attachment))
// .ToolTips(tt => tt.Add(
// Html.X().ToolTip()
// .Items(
// Html.X().Label()
// .Text(GlobalResources.TooltipBrowseForEvidenceToSubmit)
// )
// )
// )
// .Listeners(l =>
// {
// l.Change.Fn = "fnFileSelected";
// }
// ),
Html.X().Button()
.ID("SEND_BUTTON_ID")
.Border(true)
.Center()
.Icon(Icon.EmailGo)
.Hidden(true)
.Text( String.Format("{0} {1}", GlobalResources.Send, GlobalResources.Message))
.DirectEvents(de =>
{
de.Click.Url = Url.Action("DirectEventSendMessage", "User");
de.Click.FormID = "NEW_MESSAGE_FORM_PANEL";
de.Click.EventMask.ShowMask = true;
de.Click.IsUpload = true;
de.Click.Before = @"if (!#{NEW_MESSAGE_FORM_PANEL}.getForm().isValid()) { return false; }";
de.Click.Success = "fnMessageSendSuccess(result)";
de.Click.Failure = "fnMessageSendFailure(result)";
}
),
Html.X().Button()
.Text("Reset Form")
.OnClientClick("#{NEW_MESSAGE_FORM_PANEL}.getForm().reset();")
)
) // end of Create New Message fieldset items
)
)
Last edited by Daniil; Apr 01, 2014 at 5:30 PM.
Reason: [CLOSED]