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

How can I use the client object model in javascript to have a function to refresh a list view?

Scenario: I have a form that uses a button which uses the sharepoint client object model to insert a list item, but after its finished it does not refresh on its own, no I dont want it to refresh automatically every 15 seconds, I want it to refresh the moment the item gets inserted like in the out of the box forms, how can I achieve this?

share|improve this question
add comment

2 Answers

You can use a Item Adding event that will do a partial post back as you said your using "Forms" or you can use AJAX update panel

Check this link out as well, its for webparts but I guess your using ListView Webpart so might help, plus which forms are you using ?

how-to-automatically-refresh-sharepoint

share|improve this answer
add comment

Hi from what I guess is you want to refresh a list view when an item has been added via client side using a javascript function?

you can do that using this: there is a method called "Enable Asynchronous Update" what would do the trick ;), this is out of the box function that already exists.

http://weblogs.asp.net/jan/archive/2010/03/01/little-sharepoint-2010-gem-ajax-options-in-list-view-web-parts.aspx

also using SPGridView you can build your list, bind the data from the database and then wack it in an updatepanel!

It is much faster, safer, easier and above all adhears to the sharepoint client object model

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.