Copied to clipboard

Flag this post as spam?

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


  • Kevin C. Halpin 27 posts 108 karma points
    Jul 13, 2018 @ 17:10
    Kevin C. Halpin
    0

    Set value to radio button list in nested content programatically

    I have a nested content in one document type which I would like to fill from back end. I have a radio button list in the nested content. I managed to fill out the other text area properties except for the radio button list. I've read that I need to set the value of the nested property to the following json:

    {
        "name" : "Some item name",
        "ncContentTypeAlias" : "yourDocTypeAlias",
        "propertyAlias1" : "some value 1",
        "propertyAlias2" : "some value 2"
    }
    

    Here's my code so far:

     var ncItems = new List<NestedItem>();             
                        foreach(var item in items)
                        {
                            var ncItem = new NestedItem();
                            ncItem.name = item.name;
                            ncItem.ncContentTypeAlias = "docTypeAlias";
                            ncItem.type = "radio-button-value"; // this is what it's not working
                            ncItem.placeName = item.name;                         
                            ncItem.distance = "0";
    
                            ncItems.Add(ncItem);
                        }
    
                        var ncItemString = Newtonsoft.Json.JsonConvert.SerializeObject(ncItems);
    
                        en.SetValue("nestedContentProperty", ncItemString);
    
  • Kevin C. Halpin 27 posts 108 karma points
    Jul 16, 2018 @ 14:17
    Kevin C. Halpin
    0

    Anyone??

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    May 16, 2019 @ 23:08
    Alex Skrypnyk
    0

    Hi Kevin

    Did you solve the issue? Can you share with our community?

    Thanks,

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft