2 Responses to Enable SharePoint 2010 ratings and social data features

  1. jmillman says:

    Thanks for the post. I have two questions though.
    1. Can I add this control to a web part? I have been trying without luck. I can access the two fields easily via a webpart. If I add the control to my web part it will not display at all.
    SPListItem li = SPContext.Current.ListItem;
    object testObj = li["Number_x0020_of_x0020_Ratings"];

    2. Do you have any idea about the logic behind the ratings? Meaning, can a user keep rating something, or will it only allow one rating per user. I would think they would protect against a user skewing the results, but I am not sure how they do it. I was thinking of manually updating the two columns just to avoid the latency, but I am not sure how their actual ratings work.

    Thanks, I would really like some input on question 1 if you have any ideas.

  2. Hi jmillman,

    1. Rating control is basically a set of javascript and DOM that is sealed as a single control and output to a browser. I haven`t tried it on a webpart, but, since it requires the context of the item it`s trying to rate – I assume it can only be placed on a webpart within Display/Edit form. If you place it on a random page it won`t know the context of an item which your trying to rate and therefore refuse to render.

    2. User can cast rating, which is picked up by timer job and average is calculated. Same user can cast another rating on the same item later and this new rating will take place of the old rating and average will be recalculated. In essence users can change their mind about the rating. That`s how it works now, I don`t know if MS plans to change it.