Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
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 Jul 28 '10 at 0:46
    
See my additional comments above... –  Marc D Anderson Jul 28 '10 at 3:52
    
Marc, thanks for all of the help you have given to me. I appreciate it. –  Anonymous Jul 28 '10 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 Aug 5 '10 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> –  Marc D Anderson Aug 9 '10 at 4:06
show 1 more comment

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.

share|improve this answer
    
Thanks James, I will try it. Could a post back possibly send the value back to the server if it was necessary? –  Anonymous Jul 24 '10 at 15:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.