Monday, October 26, 2009

Content Editor Web Parts, Standard Personal Views, and lists don't work together, Or "Something Sandy discovered..."

I started tweeting in July, to celebrate the SharePoint Saturday Baltimore event. Around July 28th, I noticed a tweet by a nice lady in my neighborhood named Sandy Ussia saying she was having a problem with List Views. I checked it out and discovered she's right.

Here's what happened.

She wanted to create a personal view on a list in SharePoint. In that personal view, she wanted to add a content editor web part.

But when she created a personal view of a list and then edited the page so she could add a content editor web part, things went wobbly. The list itself disappeared from the page and the content editor web part could not be edited. If you left edit mode on that view-- the page would be empty.

It happened for her, it happened for me, it was crazy. It didn't empty all the time, only if you edited the page and tried to add a content editor web part from the Site Actions menu. If you edited the page in personally, from the Welcome Menu, it would keep the list view web part, but would never, ever, ever, no matter what you did, let you add that content editor web part.

Let me show you,

I decided to simply work with the easy and ubiquitous "Announcements" list, but it seems just about any list will do.

I went to the Announcements list, showing the standard "all items" view.

I then clicked on the View drop down and selected Create View. I then selected Standard View as my type of view.

On the create view page, I named the view (MyView1) and set it to be a personal view. I kept the default fields and settings for the demo, the important part is that it's personal, and clicked OK.

And, unsurprisingly, ended up back on the list page, in my new view.

I then went to edit that view so I could add a content editor web part (otherwise known affectionately as the CEWP). Now there are two ways to get into edit mode on this page, from under Site Settings, or under the Welcome menu, Personalize this page. But when I try to edit it in Shared View, the list view web part disappears-- which makes sense, since the view is private. Therefore, to edit this page, I am using the Welcome menu, Personalize this page.

In edit mode, click on Add a web part.

In the Add web parts list, scroll down and select Content Editor Web Part and click Add.

Back on the List page, you'll see that now you can edit the CEWP that you just added.

Click on the link in the new web part so you can you can open the tool pane and start editing the content editor web part. Keep in mind that at this point the new web part has absolutely nothing in it, so of course you'd want to add data...

...but when you do, you'll get an error saying you can't edit the web part you just added (and the list view web part might disappear right then)-- "The web part you attempted to change is either invalid or has been removed by another user.". If you try to exit edit mode, or refresh, like it says in the tool pane, it drops out of edit mode and the CEWP just goes away as if you didn't try to add it.

If you try to edit it using Site Actions, edit page, the list itself goes away and you are left with an empty page that doesn't even have a list view box to click on (although I have a very battered install, so that might not happen to everyone).

(what I did to get out of that, was go to the Welcome menu, and select Show personal view. Then, in that view, since the view list showed up, I went back to all items...)

It looks to be a pretty bad bug, and one no one else seems to even think about (I wonder if it'll be in the 2010 version?).

You've been warned. To recap-- don't try adding a content editor web part to a standard, personal view of a list.

Thanks Sandy.

(and you may have noticed a sudden rise in posts, particularly about past things. Well, my health's been a little sketchy, so while I'm okay, I'm trying to catch up. Expect more, especially as I do more with SPF 2010 when the next beta build comes out)

No comments: