How to use SPServices to popup a msg without postback

Mar 1, 2012 at 7:22 AM

Hi All,
    I would like to use GetListItems to popup ameesage when there is a new item in alist , doc lib etc.
I want it to happen without a post back.So if the user is on a page and something changes it pops up.

Is this possible.

Thanks in advance

Coordinator
Mar 1, 2012 at 5:13 PM

Probably. You could run a function at a regular interval on the client to check the list using setTimeout().

M.

Mar 1, 2012 at 9:11 PM

I agree with Marc. I actually use something similar. The following piece of code will call the UpdateListItem() function every 2 minutes as long as the session is active. I use this to make sure that the (rather long) form is saved automatically every two minutes while the user is filling it out.

window.setInterval(function() { UpdateListItem(); }, 120000);
Mar 2, 2012 at 3:55 AM

Naijacoder,
What you ask below can be done, but it will take more than SPServices. Its a design question. First you probably want to build your own display page where you have control over how the items are displayed. You have to then build code that periodically queries the server (SharePoint) to detect if a new item has been created (example: use of set interval()). If using GetListItems then you will be looking for any rows created from the time the page is initially loaded. If any are found, then you add them to the display area using the same method used initially to create the display of the data. At this time you would also reset the date used in your query and start the process over again.

Hope this help. Good luck.

Paul

Sent from mobile

On Mar 1, 2012 2:23 AM, "naijacoder" <notifications@codeplex.com> wrote:

From: naijacoder

Hi All,
I would like to use GetListItems to popup ameesage when there is a new item in alist , doc lib etc.
I want it to happen without a post back.So if the user is on a page and something changes it pops up.

Is this possible.

Thanks in advance

Read the full discussion online.

To add a post to this discussion, reply to this email (SPServices@discussions.codeplex.com)

To start a new discussion for this project, email SPServices@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com