Copied to clipboard

Flag this post as spam?

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


  • Matthew Berner 47 posts 327 karma points
    Oct 04, 2019 @ 17:53
    Matthew Berner
    0

    UIOMatic Question

    UIomatic is an awesome tool. We are using UIOmatic with our Recipe database. I have a question: I have two Pocos, one is Recipes and the other is Ingredients One thing in common they share a Foreign Key called Recipe Id

    1) How do I share the ingredient information in Recipe's UI when don't share the same table. I have tried the (List) as a View and the Config did not work: Here is the code [UIOMaticField (Name ="Ingredients", View = UIOMatic.Constants.FieldEditors.List, Config = "{'typeALias':'ingredients', 'foreignKeyColumn':'RecipeId', 'canEdit':true}", Tab = "General", TabOrder = 3)] public IEnumerable<Ingredients> IngredientList { get; set; } the list is empty - I am doing wrong Thanks Matthew Berner

  • Sibren 40 posts 212 karma points c-trib
    Oct 07, 2019 @ 13:55
    Sibren
    100

    Hi,

    The typeAlias (check your typo btw) must be the name of your UI-O-Matic named class.

    Make sure the class that has the Recipe Id is decorated as such:

        [UIOMatic("recipes", "Recipes", "Recipe", FolderIcon = "icon-location-nearby", ItemIcon = "icon-pin-location", RenderType = UIOMaticRenderType.List, Order = 6)]
    [TableName("Recipe")]
    public class RecipeModel {
        [PrimaryKeyColumn(AutoIncrement = true)]
        public int RecipeId { get; set; }
    

    }

    Please not the lower case recipes. Use that in your Ingredients config:

    (...)'typeAlias':'recipes', 'foreignKeyColumn': 'RecipeId'(...)
    

    Please note: I had some weird bug when the ID-column was not named ID. So if you run into any other errors, rename RecipeId to Id accordingly.

  • Matthew Berner 47 posts 327 karma points
    Jan 29, 2021 @ 15:52
    Matthew Berner
    0

    Sibren That did work Thanks Matthew Berner

Please Sign in or register to post replies

Write your reply to:

Draft