No one has responded to this discussion for at least a year, so this information may be out of date. If you're looking for information about this topic, please search for a more recent discussion or post a new question.

Persisting web part properties with PersonalizationScope.Shared

  • 2 Followers
  • 2 Replies |
  • This post has 0 verified answers |
Answered (Not Verified) This question has suggested answer(s)

I have created WSS 3.0, MOSS 2007, SharePoint Foundation 2010 and SharePoint Enterprise 2010 web parts with a bevy of custom properties to set. With the aforementioned platforms everythings persists as you would expect.

 

However, with the online SharePoint instance for the 365 beta, bool fields are not being persisted using the same method that has been working for me. Interestingly, text fields persist just fine.

 

Here is how I mark a boolean field:

 

private bool _showWorkspaces = true;

 

[Personalizable(PersonalizationScope.Shared),

WebBrowsable(true),

LocalizedWebDisplayName("String1"),

LocalizedWebDescription("String2"),

Category("My Category")]

public bool ShowWorkspaces

{

    get { return _showWorkspaces; }

    set { _showWorkspaces = value; }

}

 

The above field will display correctly in the web part editor 'backpage', and I can even adjust the settings and the new value will flow through to the web part correctly. However, when I call up the web part editor again, all bool fields will be 'false'.

 

Let me know if you would like more information.

 

Thanks!

 

  • Post Points: 20
All Replies
  • I am sorry to hear you are having issues with your custome web parts. Since we do not support custom code, I've gathered a couple of resources which may be helpful in answering your questions. In terms of the issue itself, since we don't support custom code, it would be a "best effort" scenario of support.  Meaning that if the answer isn't something very clear that we can see right away, we would not be able to dig into the issue any further.  Here are the aforementioned links to the resources. I do apologize we aren't able to dig into this issue any further. Best of luck with your research.

    SharePoint Online for Office 365: Developer Guide

    www.microsoft.com/.../details.aspx

    Microsoft Office 365 Beta Deployment Guide for Enterprises

    community.office365.com/.../default.aspx

    • Top 200 Contributor
    • Post Points: 0
    Suggested by
  • Hi Mike,

    Thank you for the links but I couldn't find an answer in them. We noticed that while the boolean custom properties exhibited this odd behavior, text and dropdown fields worked as expeted. So we created a 'Boolean Enum' instead. It's a bit clunkier than simply clicking in a checkbox, but at least the values persist.

    Here's our writeup on it with screenshots:

    www.teamdirection.com/.../viewtopic.php

    Otherwise we are very pleased with how our silverlight gantt chart is working within SharePoint online. It's a great user experience to simply upload our WSP file and activate it. Nice job!

    • Not Ranked
    • Post Points: 0
Page 1 of 1 (3 items)