Changing ThreadID dynamically

Forums Comment box for SharePoint Changing ThreadID dynamically


This topic contains 3 replies, has 2 voices, and was last updated by  Alexander Bautz 3 years, 5 months ago.

  • Author
  • #10477


    Hello Alex,
    I’m trying to figure out what is the best way to accomplish this:
    I have a page consisted out of an iFrame and a link Bar. Clicking on each Link updates the src of the iFrame. I do this with some JS function.
    What I want is to have the Comments box to show a different Thread for a each link I click.

    ex: Click on a link “Section A” will display “Http://some address/A” in Iframe and will display all comments of thread “Section_A”.
    (I couldn’t figure out how to update the cBoxArg Configuration object, maybe JQuery?)


    • This topic was modified 3 years, 5 months ago by  kman3d.
  • #10528

    Alexander Bautz

    I’m not sure I understand, but updating an object is just like this:

    cBoxArg.ThePropertyYouWantToChange = "the new value";


  • #10575


    O.k,but after I update the object, how do I reload the comments instance?
    Also,is this object is global? (can i update it from another script in a different CEWP?)

    • This reply was modified 3 years, 5 months ago by  kman3d.
  • #10619

    Alexander Bautz

    There is no built in method to “kill” the current cBox instance to rewrite it, but you should be able to use this code:

    // Clear existing cBox
    // Change the placeholderID and threadID
    cBoxArg.placeholderID = "commentBoxInstanse_2";
    cBoxArg.threadID = "commentBoxInstanse_2"+cBoxArg.threadID.split(":")[1];
    // reset data object = {}; = {}; = []; = {}; = {};
    // Call function

    Note the placeholderID “commentBoxInstanse_1” which is the default one, which is changed to “commentBoxInstanse_2”. This means you must have a placeholder for each of the cBox instances on the page.

    Hope this helps,

You must be logged in to reply to this topic.