locked
Pass custom views to list view web part RRS feed

  • Question

  • Apologies in advance if I don't use the right terminology.  I'm not a developer, just the most IT-acclimated writer in my organization.

    I have a web part page on a SharePoint 2007 server with a list view web part connected to an issues list where I've created several different views (My Issues, All Open Issues, All Working Issues, All Closed Issues).  I'd like to set up links on my web part page such that users can click and easily change the Current View to one of the aforementioned views, but without allowing users to monkey around on the page.

    Does that make sense? I have access to SPD 2007 and know just enough HTML, XML, and JavaScript to be dangerous.

    • Moved by Mike Walsh FIN Tuesday, July 19, 2011 6:28 AM states access to spd - does not state access to vs (From:SharePoint - Development and Programming (pre-SharePoint 2010))
    Tuesday, July 19, 2011 12:35 AM

Answers

  • Hi Chris,

    So you have 2 lists, and a maximum of 4 views per list? Your situation reminds me of a blog post I found not too long ago. First, however, I have a question: does the 2 list solution work well for you? Not to be a trouble maker, but Issue Reporting and Issue Resolution sound like they would share a lot of common fields, and might do well combined into one list. To follow-up on what J said, you could put the relevant users into a group that has viewing rights to the list, but not edit. They could then access the views the conventional way, via the View menu.

    If you want to go with your original plan for users, the basic idea would be to have one list view web part for each of your views, plus a summary of the views with links. Some JavaScript is used to display or hide the various views based on what the user clicks.

    Please see: https://www.nothingbutsharepoint.com/sites/eusp/Pages/dynamically-showhide-multiple-web-parts.aspx. It relates to displaying different views of a Tasks list. I haven't looked at it too closely, but you should be able to modify it to your needs.

    Good luck,

    Eric

    • Marked as answer by ChrisPEditor1 Wednesday, July 20, 2011 1:45 AM
    Wednesday, July 20, 2011 1:14 AM

All replies

  • I don't have access to Visual Studio, but I suppose I could probably get access, if it's required to get the job done.
    Tuesday, July 19, 2011 4:25 PM
  • Hi Chris,

    I think you're using the right terminology, but could you please explain your situation a little more? The standard way to select different views of a list is via the View menu drop-down, on the far right of the web part's menu bar.

    If this doesn't work for you, please elaborate on why, and what you hope to accomplish instead. I'd also be curious about your fear of users "monkeying around" on the page. That sounds more like a permissioning issue.

    Best wishes,

    Eric

    Tuesday, July 19, 2011 9:26 PM
  • Eric,

     

    Thanks for replying, I'd be happy to give you more information.

    I have two lists.  One for Issue Reporting, and one for Issue Resolution.  My fellow writers are a little technically challenged, so to keep them from monkeying around with the lists themselves (where you actually can change the views with the drop down on the far right of the menu bar), I've set up a web part page with list view web parts that are essentially reporting the contents of the lists.  I'd like to give the users the ability to change the default view of the list view web part, without giving them access to the list page or giving them the ability to edit the list view web parts.

    I felt like I would be able to somehow pass the unique URLs for each of the custom views I've created to the list view web part, but I'm not sure how to do that.

    Is that a little clearer?

    Thanks again!

    Chris

    Tuesday, July 19, 2011 10:04 PM
  • Chris,

    Eric is correct. You can prevent your co-workers from 'monkeying around' with the views using permissions. If the users only have contribute permissions to those lists then they will not be able to edit existing views or create any public views. If you have site collection administrator rights you can edit or copy the permission level and uncheck "Manage Personal Views" to prevent them from creating personal views as well.

    J

    Tuesday, July 19, 2011 11:28 PM
  • Hi Chris,

    So you have 2 lists, and a maximum of 4 views per list? Your situation reminds me of a blog post I found not too long ago. First, however, I have a question: does the 2 list solution work well for you? Not to be a trouble maker, but Issue Reporting and Issue Resolution sound like they would share a lot of common fields, and might do well combined into one list. To follow-up on what J said, you could put the relevant users into a group that has viewing rights to the list, but not edit. They could then access the views the conventional way, via the View menu.

    If you want to go with your original plan for users, the basic idea would be to have one list view web part for each of your views, plus a summary of the views with links. Some JavaScript is used to display or hide the various views based on what the user clicks.

    Please see: https://www.nothingbutsharepoint.com/sites/eusp/Pages/dynamically-showhide-multiple-web-parts.aspx. It relates to displaying different views of a Tasks list. I haven't looked at it too closely, but you should be able to modify it to your needs.

    Good luck,

    Eric

    • Marked as answer by ChrisPEditor1 Wednesday, July 20, 2011 1:45 AM
    Wednesday, July 20, 2011 1:14 AM
  • Eric and J,

    Thanks to you both for your suggestions.

    The 2 list solution works because of the requirement: that I have one list that only the writers see, where they can report issues and log comments on those issues, and another list only the managers have access to where they are assigned issues added by their direct reports.

    Both lists are also required to run the workflows I've developed for alerting either party to status changes and updates.

    It sounds like dynamically hiding multiple web parts is the way to go.

    Thanks again!

    Chris 

    Wednesday, July 20, 2011 1:48 AM