Jul 10, 2013, 3:10 PM
[CLOSED] Issues with a complex layout of many partials
Firstly, I realise that your stock reply will be "please supply an example that shows the problem" but as that will take time, I'm going to explain the issues first.
My site (MVC Razor) uses a complex layout based on partials which are included dynamically based on view model data e.g the default Razor master _layout.cshtml uses model data to load partials using ComponentLoader using ...
Now, the first issue.
If any component specifies a .Render or a .Listener or a .Icon I occassionally get an error popup with .....
Ext.ComponentManager.onAvailable("_SubmitEvidence" ,function(){Ext.net.append(Ext.getBody(),[" ","
More frequently, I get a full blown runtime exception ....
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 246: {
Line 247: BaseControl.SectionsStack.Push(new List<string>());
Line 248: var result = Ext.Net.X.Builder.HtmlHelper.Partial(partialViewNa me);
Line 249: this.HandleResult(result);
Line 250: return this as TBuilder;
Source File: c:\Users\mckelvied\Projects\VS2012 Projects\Ext.Net SVN v2.2.1\Ext.Net\MVC\Factory\AbstractContainerBuilde r.cs Line: 248
If I comment out all .Render, .Listener and .Icon directives, I do not get the Ext.ComponentManager.onAvailable error any more but do occassionally get the full blown exception (maybe 1 in 10 page loads). This points to a timing triggered issue.
If I have even just one of .Render, .Listener and .Icon directives in any partial, it will generate a full blown exception every page load.
Any inital thoughts?
My site (MVC Razor) uses a complex layout based on partials which are included dynamically based on view model data e.g the default Razor master _layout.cshtml uses model data to load partials using ComponentLoader using ...
.Items( layout =>
{
for (int item = 0; item < @Model.PageItems.Count; item++)
{
PageItem pi = @Model.PageItems.ElementAt(item);
layout.Add(
Html.X().Panel()
.BaseCls("x-plain")
.ID(pi.Id)
.Border(false)
.Loader(Html.X().ComponentLoader()
.Url(Url.Action(pi.ActionUrl))
.Mode(LoadMode.Script)
.Params(new { containerId = pi.ContainerId })
)
);
}
The controller actions are "out-of-the-box" ..... public Ext.Net.MVC.PartialViewResult _CandidateHomeHeader(string containerId)
{
return new Ext.Net.MVC.PartialViewResult
{
RenderMode = RenderMode.AddTo,
ContainerId = containerId,
WrapByScriptTag = false // we load the view via Loader with Script mode therefore script tags is not required
};
}
The ResourceManager is invoked from in _layout.cshtml and each "view" uses this master layour. Each partial loaded in the above way, may load additional partials using ItemsFromPartial(...) on components. Now, the first issue.
If any component specifies a .Render or a .Listener or a .Icon I occassionally get an error popup with .....
Ext.ComponentManager.onAvailable("_SubmitEvidence" ,function(){Ext.net.append(Ext.getBody(),[" ","
More frequently, I get a full blown runtime exception ....
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 246: {
Line 247: BaseControl.SectionsStack.Push(new List<string>());
Line 248: var result = Ext.Net.X.Builder.HtmlHelper.Partial(partialViewNa me);
Line 249: this.HandleResult(result);
Line 250: return this as TBuilder;
Source File: c:\Users\mckelvied\Projects\VS2012 Projects\Ext.Net SVN v2.2.1\Ext.Net\MVC\Factory\AbstractContainerBuilde r.cs Line: 248
If I comment out all .Render, .Listener and .Icon directives, I do not get the Ext.ComponentManager.onAvailable error any more but do occassionally get the full blown exception (maybe 1 in 10 page loads). This points to a timing triggered issue.
If I have even just one of .Render, .Listener and .Icon directives in any partial, it will generate a full blown exception every page load.
Any inital thoughts?
Last edited by Daniil; Jul 30, 2013 at 4:12 AM.
Reason: [CLOSED]