HELP with Prevalue Source fields Error on Data Source Contour Form
Hi..
Anybody come accross this error, when you create a form with SQL data source contour and put one of the fields with prevalue source(for example drop down list, radio, etc) the form cannot be created. But when you create the form with textstring or textarea only,, something that does not require any prevalue source .. they worked fine..
However the error is as follow:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Umbraco.Forms.UI.Usercontrols.EditForm.GetPrevalueAttributes(Field f) +441
ASP.usercontrols_umbracocontour_editform_ascx.__DataBind__control9(Object sender, EventArgs e) +2042
System.Web.UI.Control.OnDataBinding(EventArgs e) +91
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
System.Web.UI.Control.DataBind() +15
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +127
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +478
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
System.Web.UI.WebControls.Repeater.DataBind() +76
Umbraco.Forms.UI.Usercontrols.EditForm.RenderFieldset(Object sender, RepeaterItemEventArgs e) +405
System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +115
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +138
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +478
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
System.Web.UI.WebControls.Repeater.DataBind() +76
Umbraco.Forms.UI.Usercontrols.EditForm.RenderPage(Object sender, RepeaterItemEventArgs e) +405
System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +115
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +138
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +478
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
System.Web.UI.WebControls.Repeater.DataBind() +76
Umbraco.Forms.UI.Usercontrols.EditForm.Page_Load(Object sender, EventArgs e) +1050
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.431
I tried the suggestion above to change the compilation debug to true,, it produced another error:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 241: copy</a> <a class="iconButton delete" href="#" onclick="javascript:DeleteField('<%# ((Umbraco.Forms.Core.Field)Container.DataItem).Id %>');">
Line 242: delete</a> <span class="handle">handle</span>
Line 243: <div class="fieldprevalues" style="display: none;" <%# GetPrevalueAttributes(((Umbraco.Forms.Core.Field)Container.DataItem)) %>>
Line 244: <asp:Repeater ID="rptPrevalues" runat="server">
Line 245: <ItemTemplate>
Source File: c:\Users\Dewi\Downloads\UmbracoSites\umbraco_4711\build\usercontrols\umbracoContour\EditForm.ascx Line: 243
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Umbraco.Forms.UI.Usercontrols.EditForm.GetPrevalueAttributes(Field f) +440
ASP.usercontrols_umbracocontour_editform_ascx.__DataBind__control9(Object sender, EventArgs e) in c:\Users\Dewi\Downloads\UmbracoSites\umbraco_4711\build\usercontrols\umbracoContour\EditForm.ascx:243
System.Web.UI.Control.OnDataBinding(EventArgs e) +91
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
System.Web.UI.Control.DataBind() +15
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +127
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +478
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
System.Web.UI.WebControls.Repeater.DataBind() +76
Umbraco.Forms.UI.Usercontrols.EditForm.RenderFieldset(Object sender, RepeaterItemEventArgs e) +405
System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +115
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +138
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +478
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
System.Web.UI.WebControls.Repeater.DataBind() +76
Umbraco.Forms.UI.Usercontrols.EditForm.RenderPage(Object sender, RepeaterItemEventArgs e) +405
System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +115
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +138
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +478
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
System.Web.UI.WebControls.Repeater.DataBind() +76
Umbraco.Forms.UI.Usercontrols.EditForm.Page_Load(Object sender, EventArgs e) +1050
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
Could you shed shed some light on the db table you are trying to use? If you want to populate a dropdownlist it has to be a foreign key otherwise it won't work
HELP with Prevalue Source fields Error on Data Source Contour Form
Hi..
Anybody come accross this error, when you create a form with SQL data source contour and put one of the fields with prevalue source(for example drop down list, radio, etc) the form cannot be created. But when you create the form with textstring or textarea only,, something that does not require any prevalue source .. they worked fine..
However the error is as follow:
I tried the suggestion above to change the compilation debug to true,, it produced another error:
I'm getting the exact same thing. Umbraco 4.7.2, , Contour 1.1.12
Trying to change the fieldtype from textstring to checkboxlist.
Has anyone else seen this behaviour?
Comment author was deleted
Could you shed shed some light on the db table you are trying to use? If you want to populate a dropdownlist it has to be a foreign key otherwise it won't work
Comment author was deleted
This is an examle that works:
Creating a form based on the sample table the 'FromForeign' field wil be populated with values from the 'Other' table
Aha! Thats brilliant, thanks Tim. I feel stupid for not thinking of that now.
is working on a reply...