none
TaxonomyWebTaggingControl Set SspId and SSPList using JSOM

    질문

  • Hello Folks,

    Is there any way to set the TaxonomyWebTaggingControl Set SspId and SSPList using JSOM ?

    The requirement is to get it set on the fly - suppose depending on its parent the Taxonomy Field Control sspid/ssplist mapping should change.

    Tried using the below blog but somehow not working - 

    https://msdn.microsoft.com/en-us/library/office/dn312504.aspx?f=255&MSPPError=-2147217396

    https://www.c-sharpcorner.com/article/map-term-set-to-metadata-site-column-on-sharepoint-using-javascript-object-model/

    https://blog.vgrem.com/tag/taxonomyfieldvalue/

    https://gist.github.com/chrisobriensp/13e69f9dfb9d8221c05c

    Thanks



    • 편집됨 F MMM 2018년 7월 13일 금요일 오후 12:05
    2018년 7월 13일 금요일 오후 12:01

모든 응답

  • Hi,

    TaxonomyWebTagging Control is a Server Side Control used in SharePoint Visual Web Part, for this control Property SspId and SSPList, it needs to be set via Server Object Model since there is no Client Side API to set this two property for the server side control, you could set the property in Page_Load void based on your own logic like below:

     protected void Page_Load(object sender, EventArgs e)
            {
                SPContext context = SPContext.Current;
                SPSite site = context.Site;
                TaxonomySession session = new TaxonomySession(site);
                TermStore termStore = session.TermStores["Mananged Metadata"];
                Group group = termStore.Groups["System"];
                TermSet keywordsTermSet = group.TermSets["Keywords"];
                TestTaxonomyControl.SspId.Add(termStore.Id);
                TestTaxonomyControl.TermSetId.Add(keywordsTermSet.Id);
                TestTaxonomyControl.SSPList = termStore.Id.ToString();
                TestTaxonomyControl.AllowFillIn = true;
                TestTaxonomyControl.IsMulti = true;
            }

    And in the page, added the web part, it will show this control:

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    2018년 7월 16일 월요일 오전 8:25