Copied to clipboard

Flag this post as spam?

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


  • Mike Chambers 621 posts 1203 karma points c-trib
    Jan 13, 2017 @ 12:32
    Mike Chambers
    0

    "UIOMatic.FieldEditors.Dropdown" pass static list?

    Was wanting to just have a simple choice for the drop down that I didn't particularly want to store in a db table...

    Is there a way to pass just a value/text enumeration to the fieldEditor? rather than it having to be a foreign key related db table?

    Or should I look to create a Custom Field Editor View for this scenario?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 13, 2017 @ 12:54
    Tim Geyssens
    0

    Just just a custom editor should do the trick (you'll just need the view) , let me check there was an example on the forum

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 13, 2017 @ 12:55
  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 13, 2017 @ 13:05
    Tim Geyssens
    0

    So depending on where you store and how you name it you'll need to set the View param on the UIOMaticField attribute

    View = "~/App_Plugins/Example/mystaticpicker.html"

  • Mike Chambers 621 posts 1203 karma points c-trib
    Jan 13, 2017 @ 13:06
    Mike Chambers
    0

    Thanks Tim, swift and great answer.

  • anelectricmind 1 post 71 karma points
    Apr 06, 2017 @ 15:31
    anelectricmind
    0

    UPDATE : Found the problem. There was a typo in the example.

    property.Value should be property.value.

    Everything is working fine. thanks.

    =================================

    Hi,

    I am fairly new to Umbraco, but I have been developing web applications for about 17 years.

    I know the topic is a bit old, but...

    I like this solution, andI can't make it work. I checked the link that Tim posted, but I think I am missing something.

    I created a dropdown view that looks like this.

    <div>
    <select ng-model="property.Value">
        <option value="Locale">Locale</option>
        <option value="A">A</option>
        <option value="AA">AA</option>
        <option value="AAA">AAA</option>
        <option value="Pro">Pro</option>
    </select>
    

    Then, I added it in my Model :

      [UIOMaticField(Name = "Niveau", Description = "Sélectionnez le niveau de compétition", View = "~/App_Plugins/MyViews/level.html")]
        public string Level { get; set; }
    

    Everything's displayed fine, but I get an error when trying to save :

    "The column cannot contain null values. [ Column name = Level,Table name = TEAMS ]"

    Seems to me like the value selected is not sent to the DB. Am I missing something?

    And on a side note : Is there a way to integrate NuPickers controls into UI-O-Matic? (still haven't built any custom editors yet)

    Thanks

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies