1

I am running SharePoint Foundation on Windows Server on a hosted site. I am able to retrieve a value with jQuery from the User Information List. Using Sharepoint Designer 2010, I have added a DVWP to filter a list. There is a filter parameter wizard in Designer, but I am not able to feed the value from the jQuery to the parameter wizard. Do I need to create a form variable, or a form control that the jQuery can populate? (If so how is that done?) Can I use that form control in the DVWP? There are options to use a server variable, control, or a form field in the filter wizard. Please show me how to do this. Thank you.

2 Answers 2

1

It depends on what the value is and how you want to use it. One thing to consider is putting a placeholder in the output from the DVWP and fill it in client-side in a $(document).ready function.

You can actually use the User Information List as a DataSource in an AggregateDataSource in the DVWP. The User Information List is hidden, but it you have the appropriate permissions, you can query it. Keep in mind that your average user may not be able to, however.

The other option is to use the SharePoint Web Services to determine the user's group membership. Take a look at my SPServices jQuery library.

5
  • Thanks Marc for getting back to me. Before the form dispays the records I am trying to check if the user belongs to the Division Managers group. If so, filter the list against the DivisionId field using the Division ID that they supervise . If they do not belong to that group, then check if they belong to the Section Managers group. If so, then filter against the SectionID field using the Section that they supervise. These two values come from the User Information List and both are lookup columns. I will try using the place holders in the output of a DVWP. Thanks again for all your help.
    – Anonymous
    Commented Jul 28, 2010 at 0:46
  • See my additional comments above... Commented Jul 28, 2010 at 3:52
  • Marc, thanks for all of the help you have given to me. I appreciate it.
    – Anonymous
    Commented Jul 28, 2010 at 16:53
  • Hi Marc. To create a placeholder, do I start with the Master Page? I tried to do that and then referenced the placeholder in the DVWP with this: <asp:Content ContentPlaceHolderId="PlaceHolderDVWP"/>, but received an error. Do you have a link that would show me how to put a placeholder in a DVWP? Is the placeholder a parameter used as criteria in the where clause of the CAML query? Thank you.
    – Anonymous
    Commented Aug 5, 2010 at 21:19
  • Not that kind of placeholder. I was thinking more of something like an empty span you could fill in with script. for instance: <span id="fillMeIn"></span> Commented Aug 9, 2010 at 4:06
0

You could create a hidden field which is populated using jQuery, and your parameter use that hidden field, however your hidden field would then be populated at run-time, and I'm not entirely sure if the filter works at runtime, or if the view is filtered at the server end using the parameter.

1
  • Thanks James, I will try it. Could a post back possibly send the value back to the server if it was necessary?
    – Anonymous
    Commented Jul 24, 2010 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.