Aug 08, 2012, 3:37 PM
ComponentColumn Editor Bug?
Hello again,
First let me explain my objective. I have a field in my gridpanel that has a combo-box that reads from a seperate datasource. I'm trying to have that field show the same text value that the combo-box showed in the editor, however, I do not want to make a view or any alteration to the query that drives the gridpanel's store. I figured in the fashion of vanilla asp.net that I could make a combo-box that is a read-only copy of the one in the editor, I figured component column is the tool for the job, however I get an error when I try and implement editor. This error seems like a bug unless editor in a ComponentColumn is unsupported.
I figured I would present this in case it is truly a bug and not just an issue of an unsupported functionality.
Either way if I could get some "tried and true" methods to solve my problem that would be helpful. Once again, I don't want to modify the underlying data source which will provide the ID (FK) that correlates to the item in the lookup table that the state drop down is driven by. At least that is my last option if there is no better way.
Thanks!
First let me explain my objective. I have a field in my gridpanel that has a combo-box that reads from a seperate datasource. I'm trying to have that field show the same text value that the combo-box showed in the editor, however, I do not want to make a view or any alteration to the query that drives the gridpanel's store. I figured in the fashion of vanilla asp.net that I could make a combo-box that is a read-only copy of the one in the editor, I figured component column is the tool for the job, however I get an error when I try and implement editor. This error seems like a bug unless editor in a ComponentColumn is unsupported.
<ext:ComponentColumn ColumnID="StateId" runat="server" DataIndex="StateId" Header="StateId">
<Component>
<ext:SelectBox ID="select1" runat="server" DisplayField="Name" ValueField="Id" EmptyText="Select a State..." Enabled="false">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Id" />
<ext:ModelField Name="Name" />
</Fields>
<Proxy>
<ext:AjaxProxy Json="true" SortParam="sort" LimitParam="limit" StartParam="start" PageParam="page">
<API Read="/State/Read" />
<ActionMethods Read="GET" />
<Reader>
<ext:JsonReader Root="data" MessageProperty="Message" TotalProperty="total" />
</Reader>
</ext:AjaxProxy>
</Proxy>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:SelectBox>
</Component>
<Editor>
<ext:SelectBox ID="select2" runat="server" DisplayField="Name" ValueField="Id" EmptyText="Select a State...">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="Id" />
<ext:ModelField Name="Name" />
</Fields>
<Proxy>
<ext:AjaxProxy Json="true" SortParam="sort" LimitParam="limit" StartParam="start" PageParam="page">
<API Read="/State/Read" />
<ActionMethods Read="GET" />
<Reader>
<ext:JsonReader Root="data" MessageProperty="Message" TotalProperty="total" />
</Reader>
</ext:AjaxProxy>
</Proxy>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:SelectBox>
</Editor>
</ext:ComponentColumn>
Generates the error[HttpException]: Type 'System.Boolean' does not have a public property named 'SelectBox'.
at System.Web.UI.ControlBuilder.GetChildPropertyBuilder(String tagName, IDictionary attribs, Type& childType, TemplateParser templateParser, Boolean defaultProperty)
at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty)
at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)
at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
[HttpParseException]: Type 'System.Boolean' does not have a public property named 'SelectBox'.
at System.Web.UI.TemplateParser.ProcessException(Exception ex)
at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
[HttpParseException]: Type 'System.Boolean' does not have a public property named 'SelectBox'.
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
at System.Web.UI.TemplateParser.Parse()
at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
at System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.FileExists(String virtualPath)
at System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromGeneralName(ControllerContext controllerContext, List`1 locations, String name, String controllerName, String areaName, String cacheKey, String[]& searchedLocations)
at System.Web.Mvc.VirtualPathProviderViewEngine.GetPath(ControllerContext controllerContext, String[] locations, String[] areaLocations, String locationsPropertyName, String name, String controllerName, String cacheKeyPrefix, Boolean useCache, String[]& searchedLocations)
at System.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext controllerContext, String viewName, String masterName, Boolean useCache)
at System.Web.Mvc.ViewEngineCollection.<>c__DisplayClassc.<FindView>b__b(IViewEngine e)
at System.Web.Mvc.ViewEngineCollection.Find(Func`2 lookup, Boolean trackSearchedPaths)
at System.Web.Mvc.ViewResult.FindView(ControllerContext context)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
at System.Web.Mvc.Controller.ExecuteCore()
at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<>c__DisplayClassb.<BeginProcessRequest>b__5()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()
at System.Web.Mvc.MvcHandler.<>c__DisplayClasse.<EndProcessRequest>b__d()
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
This happens regardless of what I put in the Editor tag. Removing the contents of editor (can leave the editor tag itself) fixes the problem. Returning it to a normal column type also fixes the problem.I figured I would present this in case it is truly a bug and not just an issue of an unsupported functionality.
Either way if I could get some "tried and true" methods to solve my problem that would be helpful. Once again, I don't want to modify the underlying data source which will provide the ID (FK) that correlates to the item in the lookup table that the state drop down is driven by. At least that is my last option if there is no better way.
Thanks!