SPRedirectWithID only kind of working for me, please help

Mar 24, 2010 at 3:47 PM
First, your library is fantastic, and I really appreciate all the work you have done.
Secondly, I'm having an issue with SPRedirectWithID kind of working and I was hoping you might be able to provide some insight.
I'm trying to use SPRedirectWithID. It's only partially working. Here is the behavior I am seeing:
  1. The new form is displayed.
  2. I enter data and click OK
  3. I see the page refreshes, i see the data that i entered into the form. At this point, when i inspect the URL, I am able to see an item ID.
  4. I am NOT redirected to the edit form (YET)
  5. I click OK (again) and it I am redirected to the edit form which is customized and includes an additional ASCX control.
Here's the code which I have placed right below the "PlaceHolderMain" content place holder. BTW , it's cut/pasted from the example docs: 
<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery-1.3.2.js"></script>
<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery.SPServices-0.4.0.js"></script>
<script language="javascript" type="text/javascript">
	$(document).ready(function() {
		$().SPServices.SPRedirectWithID({	
			redirectUrl: "EditForm.aspx"
		});
	});
</script>
Anyway, if possible, please give me some insight into this issue. It seems like it's working but there is a slight glitch.
Mar 24, 2010 at 4:19 PM

As an addendum, this seems to function properly about 50% of the time. I'm not sure what's going on. 

Thanks, 

Dan

Coordinator
Mar 24, 2010 at 4:29 PM

Dan:

There have been a few other people who have had this issue and I haven't been able to get to the bottom of it yet.  If you're willing to work with me a bit on it, maybe this time will be the charm.

First of all, can you upgrade to jQuery 1.4.2 and SPServices 0.5.3?  That'll ensure that you aren't dealing with any already fixed bugs. v0.4.0 is actually pretty old for SPServices. I put out new releases a lot. ;+)

Also, can you tell me about your environment? MOSS or WSS? Browser versions, etc. Anything that you think might be useful to know.

Thanks,
M.

Mar 24, 2010 at 4:58 PM

Hey, I was using the current of both. The above was a cut/past error. 

I found something that might be useful. I have two ways of creating items in these lists. 

  1. From a menu option whcih is linked to the item newform. The url is:
    1. URL in the address bar after clicking this: http://spdev/<Site>/Lists/<List>/NewForm.aspx
    2. This works perfectly, every time
  2. From the item list's NEW drop down button.
    1. http://spdev/<Site>/Lists/<List>/NewForm.aspx?RootFolder=%2FUSPA%2FLists%2FAccomplishments&Source=http%3A%2F%2Fspdev%2FUSPA%2FLists%2FAccomplishments%2FAllItems%2Easpx
    2. This breaks, every time. 

I think it has something to do with the other params on the URL when you open the new form. 

Mar 24, 2010 at 5:00 PM

Also, I'm testing with MOSS 2007 with current CU. I have tested this on a number of browsers including IE 8 and Chrome. 

Coordinator
Mar 24, 2010 at 7:09 PM

This is a great observation and I'll try to reproduce this in my environment.  The big issue I've had so far is that I haven't been able to make it happen here.  Maybe this is the clue I've needed.  Back to you soon...

M.

Coordinator
Mar 24, 2010 at 10:59 PM
Edited Mar 27, 2010 at 1:13 AM

Erg. Both paths work fine for me: no Query String parameters at all or the normal ones from the new button.  It also works fine if the List GUID and ContentTypeID are on the Query String.

This is in WSS.  I'll try MOSS next.

M.

Coordinator
Mar 25, 2010 at 10:50 PM

Ok, good news (of sorts).  I can reproduce this in MOSS.  I'll be working on a fix.

M.

Coordinator
Mar 28, 2010 at 5:42 AM

v0.5.4ALPHA1 posted which (hopdefully) fixes the bug in SPRedirectWithID.

I'd appreciate any testing you could do.  Let me know whether it works for you.

Thanks,
M.