Copied to clipboard

Flag this post as spam?

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


  • daveb.84 21 posts 46 karma points
    Nov 24, 2011 @ 13:17
    daveb.84
    0

    Dropdown list and check box Field Type settings not working

    I have created a new custom field type with a field setting that uses the drop down list control as follows:

    [Setting("Data Format", 
        description = "Data Format", 
        control = "Umbraco.Forms.Core.FieldSetting.Dropdownlist", 
        prevalues = "None,Email")]
    public string DataFormat
    {
        get;
        set;
    }
    

    This works fine when I first create a new field - I can pick an option from the drop down list and save the value. However, when I reload an existing form and change the field setting, the new value is not saved. I have also found the same problem when using a Check box field type.

    Any ideas how to get this working?

  • Comment author was deleted

    Nov 24, 2011 @ 16:19

    That's strange I'll check the issue tomorrow and let you know what I find

  • daveb.84 21 posts 46 karma points
    Nov 25, 2011 @ 10:12
    daveb.84
    0

    I've just done a bit more investigation with a field setting that has 3 prevalue options:

     

    [Setting("Add Blank Option", 
        description = "Add a blank option as the first of the selected items",
        control = "Umbraco.Forms.Core.FieldSetting.Dropdownlist",
        prevalues = "None,Blank,Please select...")]
    public string AddBlankOption
    {
        get;
        set;
    }
    

    Weirdly, I can switch between "Blank" and "Please select..." (2nd and 3rd options) and it works fine. But when I try and select the first option, it reverts back to whatever was previously selected.

    Steps to reproduce:

    1. Create a form with the field with either the second or third options selected for the field setting.
    2. Open the form again for editing, edit the field
    3. Set the field setting to the first option
    4. Click "Update Field"
    5. Edit the field again, expand the Advanced Settings
    6. The field setting has reverted back to the previous value

    So it seems that the problem is just with selecting the first option in the drop down - I suppose the code may interpret this as the field setting having no value, and therefore does nothing with it? (just a wild stab in the dark...)

    I am using Umbraco 4.7 with Contour version 1.1.11, Full version (with paid for licence)

Please Sign in or register to post replies

Write your reply to:

Draft