Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom Maton 387 posts 660 karma points
    Mar 02, 2010 @ 10:38
    Tom Maton
    0

    Create a form with RadioButtonList & DropdownList errors

    Hi All,

    I'm creating a form via the route of Data Source.

    I get is once I have connected to my data source I click "create form" and chosen my fields to use from the table then click "continue" and I select a RadioButtonList click save form I get the following error:

    [NullReferenceException: Object reference not set to an instance of an object.]
    Umbraco.Forms.UI.Usercontrols.EditForm.GetPrevalueAttributes(Field f) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:179
    ASP.usercontrols_umbracocontour_editform_ascx.__DataBind__control9(Object sender, EventArgs e) +1707
    System.Web.UI.Control.OnDataBinding(EventArgs e) +73
    System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +139
    System.Web.UI.Control.DataBind() +15
    System.Web.UI.Control.DataBindChildren() +205
    System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +149
    System.Web.UI.Control.DataBind() +15
    System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +124
    System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +435
    System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +53
    System.Web.UI.WebControls.Repeater.DataBind() +65
    Umbraco.Forms.UI.Usercontrols.EditForm.RenderFieldset(Object sender, RepeaterItemEventArgs e) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:114
    System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +78
    System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +136
    System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +435
    System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +53
    System.Web.UI.WebControls.Repeater.DataBind() +65
    Umbraco.Forms.UI.Usercontrols.EditForm.RenderPage(Object sender, RepeaterItemEventArgs e) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:102
    System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +78
    System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +136
    System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +435
    System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +53
    System.Web.UI.WebControls.Repeater.DataBind() +65
    Umbraco.Forms.UI.Usercontrols.EditForm.Page_Load(Object sender, EventArgs e) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:59
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +43
    System.Web.UI.Control.OnLoad(EventArgs e) +73
    System.Web.UI.Control.LoadRecursive() +52
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2156

    Any help would be much appreciated.

    Thanks

    Tom

     

  • Comment author was deleted

    Mar 03, 2010 @ 16:56

    Hi Tom,

    Is this when using a prevalue source or when creating a form based on a datasource?

  • Comment author was deleted

    Mar 03, 2010 @ 16:59

    Owkey I see from the trace that it occurs when using a prevalue source, are the settings on the prevalue source ok? (it should check the settings when saving the prevalue source)

  • Tom Maton 387 posts 660 karma points
    Mar 05, 2010 @ 10:50
    Tom Maton
    0

    Hi Tim,

    The values are fine and the values I manually entered them as they are just numbers 1 to 5 and not pulling from a database or anything like that.

    Thanks

    Tom

  • Comment author was deleted

    Mar 06, 2010 @ 16:48

    Thanks for the additional info Tom, will take a look at the issue on monday and hopefully include it in the next maintenance release

  • Comment author was deleted

    Mar 06, 2010 @ 16:52

    Can't reproduce the error, would it be possible to outline the steps to reproduce the error? And also what db engine are you running on?

    Thanks,
    Tim

  • Tom Maton 387 posts 660 karma points
    Mar 08, 2010 @ 16:08
    Tom Maton
    0

    Hi Tim,

    I can't seem to replicate anymore myself. Hmmm, thats annoying....

    If it happens again I will let you know.

    Thanks

    Tom

  • Comment author was deleted

    Mar 08, 2010 @ 16:30

    Owkey thanks for the update Tom

  • Joey Kincer 51 posts 83 karma points
    Mar 17, 2010 @ 08:00
    Joey Kincer
    0

    Hi there,

    I'm getting this same problem too when I try and create dropdown lists from 2 of my field properties and save the form (making all text fields goes through OK). I'm using the Dataset method from SQL Server to generate my properties.

    I do admit I'm new to the Contour thing, so maybe I'm doing something wrong. I've created a few Prevalue Sources (State and Country for the dropdowns) but I don't see how to connect those and the DataSource together. Where are the Prevalue source settings and how do I get them to talk to each other?

    Line 223:     <div class="fieldprevalues" style="display: none;" <%# GetPrevalueAttributes(((Umbraco.Forms.Core.Field)Container.DataItem)) %>>
    
    [NullReferenceException: Object reference not set to an instance of an object.]
       Umbraco.Forms.UI.Usercontrols.EditForm.GetPrevalueAttributes(Field f) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:179
       ASP.usercontrols_umbracocontour_editform_ascx.__DataBind__control9(Object sender, EventArgs e) in c:\inetpub\umbraco\usercontrols\umbracoContour\EditForm.ascx:223
       System.Web.UI.Control.OnDataBinding(EventArgs e) +99
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
       System.Web.UI.Control.DataBind() +15
       System.Web.UI.Control.DataBindChildren() +211
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
       System.Web.UI.Control.DataBind() +15
       System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +124
       System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +443
       System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
       System.Web.UI.WebControls.Repeater.DataBind() +75
       Umbraco.Forms.UI.Usercontrols.EditForm.RenderFieldset(Object sender, RepeaterItemEventArgs e) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:114
       System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +108
       System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +136
       System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +443
       System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
       System.Web.UI.WebControls.Repeater.DataBind() +75
       Umbraco.Forms.UI.Usercontrols.EditForm.RenderPage(Object sender, RepeaterItemEventArgs e) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:102
       System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +108
       System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +136
       System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +443
       System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
       System.Web.UI.WebControls.Repeater.DataBind() +75
       Umbraco.Forms.UI.Usercontrols.EditForm.Page_Load(Object sender, EventArgs e) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:59
       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) +99
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
    
  • Selah 7 posts 27 karma points
    Apr 14, 2010 @ 00:50
    Selah
    0

    I'm having the same issue. I'm creating a table from a SqlServer table datasource. Textfields work just fine, but if I select a checkbox list, for instance, I get the same error as above.

  • Comment author was deleted

    Apr 14, 2010 @ 09:17

    Hi Selah, would it be possible to provide the different steps you do ? That way I can try to reproduce the error and get it fixed!

  • Selah 7 posts 27 karma points
    Apr 14, 2010 @ 18:54
    Selah
    0

    Sure thing.

    1. Create a SQL Database Data Source in Contour
    2. Create a form for that data source
    3. Check some fields and continue
    4. For one of the fields, select either the "CheckBoxList" or "DropDownList" fieldtype
    5. Save form
    6. Boom!

    Here's the output:

    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 221: update</a> <a class="iconButton delete" href="#" onclick="javascript:DeleteField('<%# ((Umbraco.Forms.Core.Field)Container.DataItem).Id %>');">
    Line 222: delete</a> <span class="handle">handle</span>
    Line 223: <div class="fieldprevalues" style="display: none;" <%# GetPrevalueAttributes(((Umbraco.Forms.Core.Field)Container.DataItem)) %>>
    Line 224: <asp:Repeater ID="rptPrevalues" runat="server">
    Line 225: <ItemTemplate>


    Source File: c:\inetpub\ubb-survey\usercontrols\umbracoContour\EditForm.ascx Line: 223

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
    Umbraco.Forms.UI.Usercontrols.EditForm.GetPrevalueAttributes(Field f) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:179
    ASP.usercontrols_umbracocontour_editform_ascx.__DataBind__control9(Object sender, EventArgs e) in c:\inetpub\ubb-survey\usercontrols\umbracoContour\EditForm.ascx:223
    System.Web.UI.Control.OnDataBinding(EventArgs e) +99
    System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
    System.Web.UI.Control.DataBind() +15
    System.Web.UI.Control.DataBindChildren() +211
    System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
    System.Web.UI.Control.DataBind() +15
    System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +124
    System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +443
    System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
    System.Web.UI.WebControls.Repeater.DataBind() +75
    Umbraco.Forms.UI.Usercontrols.EditForm.RenderFieldset(Object sender, RepeaterItemEventArgs e) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:114
    System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +108
    System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +136
    System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +443
    System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
    System.Web.UI.WebControls.Repeater.DataBind() +75
    Umbraco.Forms.UI.Usercontrols.EditForm.RenderPage(Object sender, RepeaterItemEventArgs e) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:102
    System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +108
    System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +136
    System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +443
    System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51
    System.Web.UI.WebControls.Repeater.DataBind() +75
    Umbraco.Forms.UI.Usercontrols.EditForm.Page_Load(Object sender, EventArgs e) in d:\TeamCity\buildAgent\work\39da791f9304089a\Umbraco.Forms.UI\Usercontrols\EditForm.ascx.cs:59
    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) +99
    System.Web.UI.Control.LoadRecursive() +50
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Control.LoadRecursive() +141
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


    Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016
  • Comment author was deleted

    Apr 15, 2010 @ 09:55

    Thanks Selah,

    And what if you only make 1 field checkboxlist or dropdown, does it save succesfully in that case?

  • Selah 7 posts 27 karma points
    Apr 15, 2010 @ 17:17
    Selah
    0

    It also breaks with 1 checkboxlist or dropdown. Are you unable to reproduce the bug?

  • Comment author was deleted

    Apr 15, 2010 @ 17:23

    Hi Selah,

    Thanks for the info, no I'm not able to reproduce the error.

    Would it be possible to provide a screenshot or some info on the table you are setting up in the datasource?

  • Selah 7 posts 27 karma points
    Apr 15, 2010 @ 22:24
    Selah
    0

    I'm using SQL Server 2005 / IIS 6.0 / Windows Vista SP2

    Table schema doesn't seem to make a difference. I've tried on a few different tables on columns with varying data types.

    I just duplicated the bug against this test schema:

    CREATE TABLE [dbo].[Test](
    [One] [varchar](50) NULL
    ) ON [PRIMARY]

    The Fieldtypes that cause the error are the CheckBoxList, DropDownList, and RadioButtonList. I believe these are the field types that accept prevalues, which may have something to do with the issue.

    I am not using any prevalue sources.

    Here are links to screenshots of the problem:

    1. db setup
    2. form setup 1
    3. form setup 2
    4. boom

    And here's a link to RenderForm.aspx, which I have not altered.

    If there's any other way I can help, let me know.

  • Comment author was deleted

    Apr 17, 2010 @ 10:49

    Thanks for the detailed info!

    Currently when selecting a checkboxlist, dropdownlist, radiobutton list when creating a form based on a datasource these fields should be linked to a lookup table.

    So it's currently not possible to populate the dropdown from within the form designer.

    Will log this issue and it will be taken care of in the next release!

  • Selah 7 posts 27 karma points
    Apr 19, 2010 @ 18:58
    Selah
    0

    "Currently when selecting a checkboxlist, dropdownlist, radiobutton list when creating a form based on a datasource these fields should be linked to a lookup table."

    Is it possible to set this up when using a datasource? Otherwise, is there another workaround you can think of?

    I'm using Contour for a project with a rapidly approaching deadline, and the inability to use dropdownlists will be detrimental.

Please Sign in or register to post replies

Write your reply to:

Draft