PDA

View Full Version : [CLOSED] Error in Namespace when PartialViewResult render.



softmachine2011
Jun 11, 2012, 3:05 PM
Hi,

When I render a PartialViewResult, if the Namespace of the ResourceManager is empty, use the Namespace "App".

Example:


<ext:Panel ID="CustomGridSelector" runat="server" Width="100" Height="100" Border="false" Namespace="">
<DirectEvents>
<BeforeRender Url="<%$ RouteUrl : RouteName=Default, controller=Controls, Action=CustomGridSelector %>"
Failure="errorHandler(this, o , response);">
<ExtraParams>
<ext:Parameter Name="containerId" Value="#{CustomGridSelector}" Mode="Value" />
</ExtraParams>
</BeforeRender>
</DirectEvents>
</ext:Panel>




public ActionResult CustomGridSelector(string containerId)
{
Ext.Net.MVC.PartialViewResult pr = new Ext.Net.MVC.PartialViewResult(containerId, Ext.Net.RenderMode.AddTo);
pr.ContainerId = containerId;
pr.ControlId = containerId + "_PVR";
pr.IDMode = Ext.Net.IDMode.Static;

return pr;
}




Ext.net.append(Ext.getBody(), ["<div id=\"CustomGridSelector_PVR_UC_ideb69f0f3057dc35b_Conte nt\" class=\"x-hidden\">", " hola", " </div>"].join(''));
Ext.create("Ext.panel.Panel", {
id: "ideb69f0f3057dc35b",
height: 100,
width: 100,
xtype: "panel",
contentEl: "CustomGridSelector_PVR_UC_ideb69f0f3057dc35b_Conte nt"
});
Ext.getCmp("CustomGridSelector").add(App.ideb69f0f3057dc35b);


Is there any way to fix it?

Thanks,

Daniil
Jun 11, 2012, 8:29 PM
Hi,

A controller knows nothing about ResourceManager and its Namespace due to the fact that a controller knows nothing about a view.

You should set up it manually for the controls created in a controller using the control Namespace property. Sure, only if you change the default Namespace.

Here is the related discussion.
http://forums.ext.net/showthread.php?18961

Daniil
Jun 11, 2012, 8:49 PM
Vladimir has noted that you have already set up empty Namespace for the control.

Then you should set up

pr.SingleControl = true;
for the PartialViewResult.

In a different way, an interim Panel is created (to combine all PartialView controls) and there is the default Namespace.

We will add a possibility to set up Namespace for that interim Panel.

softmachine2011
Jun 12, 2012, 6:35 AM
Vladimir has noted that you have already set up empty Namespace for the control.

Then you should set up

pr.SingleControl = true;
for the PartialViewResult.

In a different way, an interim Panel is created (to combine all PartialView controls) and there is the default Namespace.

We will add a possibility to set up Namespace for that interim Panel.
Hi,

With SingleControl = true and Namespace="" at first partialview component, works ok!

Thanks,

Daniil
Sep 28, 2012, 2:10 PM
We added the Namespace property for the PartialViewResult. It is applied for an interim Container.

Thank you for pointing the problem out.