PDA

View Full Version : Upgrading to EXT.NET 4.0 from EXT.NET 2.5 errors



arjunsurendra
May 10, 2016, 8:20 AM
Hi , After upgrading to EXT.NET 4.0 from EXT.NET 2.5.0 , i am getting the error as below

error CS1660: Cannot convert lambda expression to type ‘Ext.Net.AbstractComponent’ because it is not a delegate type

and here below are more details from the page as follows .

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1660: Cannot convert lambda expression to type ‘Ext.Net.AbstractComponent’ because it is not a delegate type

Source Error:

Line 173: .Layout(LayoutType.HBox)
Line 174: .LayoutConfig(new HBoxLayoutConfig { Align = HBoxAlign.Middle })
Line 175: .Items(items =>
Line 176: {
Line 177: items.Add(new Container

Can anyone help ? This upgrade is not working for me
Reply

arjunsurendra
May 10, 2016, 9:41 AM
I keep getting this error .
Cannot convert lambda expression to type 'Ext.Net.AbstractComponent' because it is not a delegate type

The sample code where the error appears is here as below :

@(X.Panel()
.ID("pnlHeader")
.Layout(LayoutType.HBox)
.Region(Region.North)
.Header(false)
.Border(false)
.Height(45)
.BodyCls("header")
.Layout(LayoutType.Card)
.Items(
X.Container()
.Layout(LayoutType.HBox)
.LayoutConfig(new HBoxLayoutConfig { Align = HBoxAlign.Middle })
.Items(items =>
{
items.Add(new Container
{
LayoutConfig =
{
//new HBoxLayoutConfig {Align = HBoxAlign.Middle, DefaultMargins = "3", Pack = BoxPack.Start}
new HBoxLayoutConfig {Align = HBoxAlign.Middle, Pack = BoxPack.Start}
},
Height = 40,
//Margins = "0 0 0 0",
Items =
{
X.Image().ImageUrl("~/Resources/icons/SPARTA_Logo.png").Width(80).Height(25).MarginSpec("5 15 5 15"),
X.FieldContainer().Cls("header-nav-btn").MarginSpec("0 0 0 0").Items(
X.Button().ToggleGroup("GlobalSelector")
.IDMode(IDMode.Explicit).ID("btnGSDashboard")
.MarginSpec("0 0 0 3")
.Text("Dashboard")
.Width(BUTTON_WIDTH)
.Border(false)
.ToolTip("Dashboard (Ctrl+Alt+0)").ToolTipType(ToolTipType.Title)
.UI(UI.Info).Scale(ButtonScale.Medium)
.IconCls("dashboard-icon")
.DirectEvents(de =>
{
de.Click.Before = "return SPARTA.Tabs.ActivateTab('pnlDashboard');";
de.Click.Url = Url.Action("GetDashboard", "Dashboard");
de.Click.CleanRequest = true;
de.Click.Method = HttpMethod.GET;
de.Click.EventMask.ShowMask = false;
de.Click.EventMask.Msg = "Loading Dashboard...";
de.Click.EventMask.MinDelay = 100;
de.Click.EventMask.Target = MaskTarget.CustomTarget;
de.Click.EventMask.CustomTarget = "MainTabPanel";
de.Click.Success = "setTimeout(function() { SPARTA.Tabs.ActivateTab('pnlDashboard') }, 500)";
de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to continue because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
}),
X.Button().ToggleGroup("GlobalSelector")
.IDMode(IDMode.Explicit).ID("btnGSReleases")
.MarginSpec("0 0 0 3")
.Text("Releases")
.Width(BUTTON_WIDTH)
.Border(false).ToolTip("Releases (Ctrl+Alt+1)").ToolTipType(ToolTipType.Title)
.UI(UI.Info).Scale(ButtonScale.Medium)
.IconCls("releases-icon")
.DirectEvents(de =>
{
de.Click.Before = "return SPARTA.Tabs.ActivateTab('gpReleases');";
de.Click.Url = Url.Action("GetReleasesGrid", "Releases");
de.Click.CleanRequest = true;
de.Click.Method = HttpMethod.GET;
de.Click.EventMask.ShowMask = false;
de.Click.EventMask.MinDelay = 100;
de.Click.EventMask.Target = MaskTarget.CustomTarget;
de.Click.EventMask.CustomTarget = "MainTabPanel";
de.Click.Success = "setTimeout(function() { SPARTA.Tabs.ActivateTab('gpReleases') }, 500)";
de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to continue because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
}),
X.Button().ToggleGroup("GlobalSelector")
.IDMode(IDMode.Explicit).ID("btnGSFilms")
.MarginSpec("0 0 0 3")
.Border(false).ToolTip("Films (Ctrl+Alt+2)").ToolTipType(ToolTipType.Title)
.Text("Titles")
.Width(BUTTON_WIDTH)
.UI(UI.Info).Scale(ButtonScale.Medium)
.IconCls("films-icon")
.DirectEvents(de =>
{
de.Click.Before = "return SPARTA.Tabs.ActivateTab('gpFilms');";
de.Click.Url = Url.Action("GetFilmGrid", "Films");
de.Click.CleanRequest = true;
de.Click.Method = HttpMethod.GET;
de.Click.EventMask.ShowMask = false;
de.Click.EventMask.MinDelay = 100;
de.Click.EventMask.Target = MaskTarget.CustomTarget;
de.Click.EventMask.CustomTarget = "MainTabPanel";
de.Click.Success = "setTimeout(function() { SPARTA.Tabs.ActivateTab('gpFilms') }, 500)";
de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to continue because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
}),
X.Button().ToggleGroup("GlobalSelector")
.IDMode(IDMode.Explicit).ID("btnGSCountries")
.MarginSpec("0 0 0 3")
.Border(false).ToolTip("Countries (Ctrl+Alt+3)").ToolTipType(ToolTipType.Title)
.Text("Countries")
.Width(BUTTON_WIDTH)
.UI(UI.Info).Scale(ButtonScale.Medium)
.IconCls("countries-icon")
.DirectEvents(de =>
{
de.Click.Before = "return SPARTA.Tabs.ActivateTab('gpCountries');";
de.Click.Url = Url.Action("GetCountryGrid", "Countries");
de.Click.CleanRequest = true;
de.Click.Method = HttpMethod.GET;
de.Click.EventMask.ShowMask = false;
de.Click.EventMask.MinDelay = 100;
de.Click.EventMask.Target = MaskTarget.CustomTarget;
de.Click.EventMask.CustomTarget = "MainTabPanel";
de.Click.Success = "setTimeout(function() { SPARTA.Tabs.ActivateTab('gpCountries') }, 500)";
de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to continue because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
})
//For User Story 15210, which was started in Sprint 1.5.7, but has been delayed until Jan/Feb 2015.
//X.Button().ToggleGroup("GlobalSelector")
//.IDMode(IDMode.Explicit).ID("btnGSNonSalesTitles")
//.MarginSpec("0 0 0 3")
//.Border(false).ToolTip("Non-Sales Titles (Ctrl+Alt+3)").ToolTipType(ToolTipType.Title)
//.Text("Non-Sales Titles")
//.Width(BUTTON_WIDTH)
//.UI(UI.Info).Scale(ButtonScale.Medium)
//.IconCls("countries-icon")
//.DirectEvents(de =>
// {
// de.Click.Before = "return SPARTA.Tabs.ActivateTab('gpNonSalesTitles');";
// de.Click.Url = Url.Action("GetNonSalesTitleGrid", "NonSalesTitles");
// de.Click.CleanRequest = true;
// de.Click.Method = HttpMethod.GET;
// de.Click.EventMask.ShowMask = false;
// de.Click.EventMask.MinDelay = 100;
// de.Click.EventMask.Target = MaskTarget.CustomTarget;
// de.Click.EventMask.CustomTarget = "MainTabPanel";
// de.Click.Success = "setTimeout(function() { SPARTA.Tabs.ActivateTab('gpNonSalesTitles') }, 500)";
// de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to continue because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
// })
)
}
});

items.Add(X.Container().Flex(1));

items.Add(new Container
{
LayoutConfig = { new VBoxLayoutConfig { Align = VBoxAlign.Stretch } },
Height = 40,
Margins = "0 0 0 0",
Cls = "header-right",
Items =
{
X.Container()
.Margins("0 5 0 0")
.Layout(LayoutType.HBox)
.LayoutConfig(new HBoxLayoutConfig {Align = HBoxAlign.Middle, Pack = BoxPack.End})
.Items(
X.Label().Text(welcome).ToolTips(tt => tt.Add(new ToolTip {Html = welcomeToolTip})).Cls("welcome-text"),
X.Button()
.UI(UI.Info)
.Text(userName)
.Menu(X.Menu()
.Items(
X.MenuItem().Text("Profile").IconCls("fa fa-user fa-fw")
.DirectEvents(de =>
{
de.Click.Before = "return SPARTA.Tabs.ActivateTab('userProfile');";
de.Click.EventMask.ShowMask = true;
de.Click.EventMask.Msg = "Loading User Profile...";
de.Click.Url = Url.Action("AddUserProfile", "Users");
de.Click.CleanRequest = true;
de.Click.Method = HttpMethod.GET;
}),
X.MenuItem().Text("Log Out").IconCls("fa fa-power-off fa-fw").DirectClickUrl(Url.Action("Logout", "Accounts"))
)
),
X.Button()
.IDMode(IDMode.Explicit).ID("btnGSAdmin")
.StyleSpec("margin-left:5px;")
.UI(UI.Info)
.Text("Administration")
.Menu(X.Menu()
.Items(
X.MenuItem().Text("User Permission").IconCls("fa fa-key fa-fw")
.DirectEvents(de =>
{
de.Click.Before = "return SPARTA.Tabs.ActivateTab('gpSearchUsers');";
de.Click.Url = Url.Action("AddSearchUsers", "Admin");
de.Click.CleanRequest = true;
de.Click.Method = HttpMethod.GET;
de.Click.EventMask.ShowMask = true;
de.Click.EventMask.Msg = "Loading Users...";
de.Click.EventMask.MinDelay = 100;
de.Click.EventMask.Target = MaskTarget.CustomTarget;
de.Click.ExtraParams.Add(new Parameter("containerId", "MainTabPanel", ParameterMode.Value));
de.Click.EventMask.CustomTarget = "MainTabPanel";
de.Click.Success = "setTimeout(function() { SPARTA.Tabs.ActivateTab('gpSearchUsers') }, 500)";
de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to continue because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
}),
X.MenuItem()
.Text("Distributors")
.IconCls("fa fa-sitemap fa-fw")
.DirectEvents(de =>
{
de.Click.Before = "return SPARTA.Tabs.ActivateTab('gpDistributors');";
de.Click.Url = Url.Action("AddDistributors", "Admin");
de.Click.CleanRequest = true;
de.Click.Method = HttpMethod.GET;
de.Click.EventMask.ShowMask = true;
de.Click.EventMask.Msg = "Loading Distributors...";
de.Click.EventMask.MinDelay = 100;
de.Click.EventMask.Target = MaskTarget.CustomTarget;
de.Click.ExtraParams.Add(new Parameter("containerId", "MainTabPanel", ParameterMode.Value));
de.Click.EventMask.CustomTarget = "MainTabPanel";
de.Click.Success = "setTimeout(function() { SPARTA.Tabs.ActivateTab('gpDistributors') }, 500)";
de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to continue because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
}),
X.MenuItem()
.Text("Circuits")
.IconCls("fa fa-film fa-fw")
.DirectEvents(de =>
{
de.Click.Before = "return SPARTA.Tabs.ActivateTab('gpCircuits');";
de.Click.Url = Url.Action("GetCircuitsGridView", "Admin");
de.Click.CleanRequest = true;
de.Click.Method = HttpMethod.GET;
de.Click.EventMask.ShowMask = true;
de.Click.EventMask.Msg = "Loading Circuits...";
de.Click.EventMask.MinDelay = 100;
de.Click.EventMask.Target = MaskTarget.CustomTarget;
de.Click.ExtraParams.Add(new Parameter("containerId", "MainTabPanel", ParameterMode.Value));
de.Click.EventMask.CustomTarget = "MainTabPanel";
de.Click.Success = "setTimeout(function() { SPARTA.Tabs.ActivateTab('gpCircuits') }, 500)";
de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to continue because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
}),
X.MenuItem()
.Text("Announcements")
.IconCls("fa fa-sitemap fa-fw")
.DirectEvents(de =>
{
de.Click.Before = "return SPARTA.Tabs.ActivateTab('gpAnnouncements');";
de.Click.Url = Url.Action("AddAnnouncements", "Admin");
de.Click.CleanRequest = true;
de.Click.Method = HttpMethod.GET;
de.Click.EventMask.ShowMask = true;
de.Click.EventMask.Msg = "Loading Announcements...";
de.Click.EventMask.MinDelay = 100;
de.Click.EventMask.Target = MaskTarget.CustomTarget;
de.Click.ExtraParams.Add(new Parameter("containerId", "MainTabPanel", ParameterMode.Value));
de.Click.EventMask.CustomTarget = "MainTabPanel";
de.Click.Success = "setTimeout(function() { SPARTA.Tabs.ActivateTab('gpAnnouncements') }, 500)";
de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to continue because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
}),
X.MenuItem()
.Text("MPAA Studios")
.IconCls("fa fa-sitemap fa-fw")
.DirectEvents(de =>
{
de.Click.Before = "return SPARTA.Tabs.ActivateTab('gpMPAAStudios');";
de.Click.Url = Url.Action("AddMPAAStudios", "Admin");
de.Click.CleanRequest = true;
de.Click.Method = HttpMethod.GET;
de.Click.EventMask.ShowMask = true;
de.Click.EventMask.Msg = "Loading MPAAStudios...";
de.Click.EventMask.MinDelay = 100;
de.Click.EventMask.Target = MaskTarget.CustomTarget;
de.Click.ExtraParams.Add(new Parameter("containerId", "MainTabPanel", ParameterMode.Value));
de.Click.EventMask.CustomTarget = "MainTabPanel";
de.Click.Success = "setTimeout(function() { SPARTA.Tabs.ActivateTab('gpMPAAStudios') }, 500)";
de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to continue because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
})
)
),
X.Button()
.UI(UI.Success)
.StyleSpec("margin-left:5px;")
.Text("Help")
.Menu(X.Menu()
.Items(
X.MenuItem()
.Text("Training Videos").IconCls("fa fa-file-movie-o fa-fw")
.Listeners(li => { li.Click.Handler = "window.open('" + URL_TRAINING_VIDEOS + "',target='_blank');"; }),
X.MenuItem()
.Text("User Guide").IconCls("fa fa-file-text-o fa-fw")
.Listeners(li => { li.Click.Handler = "window.open('" + URL_USER_GUIDE + "',target='_blank');"; }),
X.Label().Html("<hr />").Height(10),
X.MenuItem()
.Text("Service Manager Request Form").IconCls("fa fa-file-text-o fa-fw")
.Listeners(li => { li.Click.Handler = "window.open('"+URL_TO_REQUEST_SERVICE_MANAGER+"');"; })
)
)
),
}
});
})
)
)

I have also attached a copy of the same file for your reference , any help /suggestion would greatly help .
Thanks in advance

edip
Jun 10, 2016, 3:04 PM
I am having the same issue since upgrading from version 2.5 to 4.1. Has there been any solution to this?

Thanks.

fabricio.murta
Jun 10, 2016, 9:08 PM
Hello @edip!

Think you can open a thread in Premium forums and provide a simplified & runnable code sample so we can get to the bottom of it?