Problem using jp.Form on site collection root lists

Apr 30, 2010 at 6:27 AM

Hi,

I'm experiencing a strange issue using jp.Form on lists that are on the site collection root site. For example, if I add a form web part with the script below in it on a task list located at http://site/lists/tasks/NewForm.aspx , I receive the popup error alerts also shown below...

  • getAlternativeComments Error: b.Lists[b.ListName.toUpperCase()] is undefined
  • An error occurred when reading the form. [object Error]
<script type="text/javascript" src="//sharejpoint.googlecode.com/files/jPointLoader.js"></script>
<script type="text/javascript">

$(document).ready( function () {

jP.Form.readForm();

});
</script>
However, if I add this same script to the NewForm.aspx on any list that is located within a subsite, eg http://site/subsite/lists/tasks/NewForm.aspx it works fine???
Even more strange is that this was working correctly last week on lists located on the site collection root site. I developed a solution using this as the basis last week and today I'm getting this issue!
Hopefully someone can help me out...
Thanks in advance
David
Coordinator
May 1, 2010 at 5:07 AM
Not sure why you are getting that error.  I am curious.  What browser did you get the error?  Until we can find the bug and fix it, call readForm function and pass in the optional parameter, SiteURL.  So write jP.Form.readForm("http://site") assuming you are on one of the lists's Form pages (i.e. NewForm.aspx). 

On Fri, Apr 30, 2010 at 1:27 AM, David_17 <notifications@codeplex.com> wrote:

From: David_17

Hi,

I'm experiencing a strange issue using jp.Form on lists that are on the site collection root site. For example, if I add a form web part with the script below in it on a task list located at http://site/lists/tasks/NewForm.aspx , I receive the popup error alerts also shown below...

  • getAlternativeComments Error: b.Lists[b.ListName.toUpperCase()] is undefined
  • An error occurred when reading the form. [object Error]
<script type="text/javascript">

$(document).ready( function () {

jP.Form.readForm();

});
</script>
However, if I add this same script to the NewForm.aspx on any list that is located within a subsite, eg http://site/subsite/lists/tasks/NewForm.aspx it works fine???
Even more strange is that this was working correctly last week on lists located on the site collection root site. I developed a solution using this as the basis last week and today I'm getting this issue!
Hopefully someone can help me out...
Thanks in advance
David

Read the full discussion online.

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

To start a new discussion for this project, email jPoint@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



May 1, 2010 at 5:14 AM
is that [object Error] just a simple non-recursive error message? Is there a way to dump the details of it to see and would that help?

On 5/1/10 12:07 PM, willhlaw wrote:

From: willhlaw

Not sure why you are getting that error.  I am curious.  What browser did you get the error?  Until we can find the bug and fix it, call readForm function and pass in the optional parameter, SiteURL.  So write jP.Form.readForm("http://site") assuming you are on one of the lists's Form pages (i.e. NewForm.aspx). 

On Fri, Apr 30, 2010 at 1:27 AM, David_17 <notifications@codeplex.com> wrote:

From: David_17

Hi,

I'm experiencing a strange issue using jp.Form on lists that are on the site collection root site. For example, if I add a form web part with the script below in it on a task list located at http://site/lists/tasks/NewForm.aspx , I receive the popup error alerts also shown below...

  • getAlternativeComments Error: b.Lists[b.ListName.toUpperCase()] is undefined
  • An error occurred when reading the form. [object Error]
<script type="text/javascript">

$(document).ready( function () {

jP.Form.readForm();

});
</script>
    
However, if I add this same script to the NewForm.aspx on any list that is located within a subsite, eg http://site/subsite/lists/tasks/NewForm.aspx it works fine???
Even more strange is that this was working correctly last week on lists located on the site collection root site. I developed a solution using this as the basis last week and today I'm getting this issue!
Hopefully someone can help me out...
Thanks in advance
David

Read the full discussion online.

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

To start a new discussion for this project, email jPoint@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



May 3, 2010 at 4:09 AM

Passing in the site URL resolved the issue....thanks for workaround.

The problem wasn't browser specific as I got the same error using both IE and Firefox. I'm still not sure why this happened as it was working fine originally...I'm also getting the same thing happening on both my dev and production enviroments...

Jun 12, 2010 at 8:53 PM

Hello All,

I am also getting the same error, while using JPoint on my list. I tried to adding the siteURL, but didnot work? How do i resolve it.

Using browser IE 7

Thank you

Jul 1, 2010 at 12:42 PM

I'm getting the same error, adding SiteURL doesn't help. (and like the OP, am on a list on the root of a Site Collection)

Any help would be appreciated.

Coordinator
Jul 8, 2010 at 6:35 AM

What do your calls to the readForm function look like?  The previously mentioned solution, I will call Solution #1, should work.

Solution #1 - For the root site, you need to call the function using readForm("http://myserver").  

Solution #2 - Or, at the top of your code, you can write:

	if (jP.valSiteURL() == "") jP.valSiteURL(location.protocol + "//" + location.host); //This means, if the code is executing on a list form on the root site collection, then specifically set the SiteURL variable to the root servername.  

Source Code Fix:

I have found a bug in jP.getList(), which is the old setSPObj() function, that incorrectly assumes if SiteURL does not have a "/", then the parameter being passed in is the ListName.  

So, on the expanded version of jPoint-0.8.js, replace line 203 with the following:

	if (SiteURL.split("/").length <=1 && SiteURL.length != "") {

Coordinator
Jul 8, 2010 at 6:36 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.