How to get CrossSiteLookup working ?

Feb 19, 2010 at 8:42 AM
Edited Feb 19, 2010 at 8:43 AM

Hi,

I'm trying to get the CrossSiteLookup part working on my site, but for some reason I don't manage to get the same result as on the example page (http://www.sharejpoint.com/examples/Lists/CrossSiteLookupDemo/NewForm.aspx)

What I did:

I have a main site "Home".
In my "Home" site I created a simple custom list "LookupTest":

Image and video hosting by TinyPic

 

Then I have a subsite in my main "Home" site, called "SharePoint Playground".
In this site, I created a simple custom list "Cross Column List Test", where I want the Title field to be a dropdown filled with values of "LookupTest" from my "Home" site.
I added a Content Editor Web Part on the NewForm.aspx page, and in the Source Editor I have this:

Image and video hosting by TinyPic

This results in the following output on the NewForm.aspx page (after save and edit):

Image and video hosting by TinyPic

 (I named my CEWP "JavaScript")

Not the output I expect, when I compare this to the example site:

Image and video hosting by TinyPic

And when I click on the "options" button I get:

Image and video hosting by TinyPic

 

Have I done something wrong in my test site ?
I don't get any Javascript error, so I have no idea why I don't get the same results as on the example site ?

Coordinator
Feb 22, 2010 at 4:38 AM

Need to change the options for your site and list.  From what I can see above, change the option fields as follow:

  • FormFieldName:  Title
  • LookupSiteURL:  /                 (this should be the absolute path to your Home site where LookupTest is)
  • LookupListName:  LookupTest
  • LookupFieldName:  LinkTitle
  • LookupDetailFieldDefinition:  LinkTitle|Title|Text
Feb 22, 2010 at 9:50 AM
Edited Feb 22, 2010 at 9:52 AM

Hi Ken,

But how do I access these options?
I don't get an "options" button in my CEWP as on the example site.
The two last images in my first post are taken from the example site, to show you the difference between what I get on my sharepoint site (3rd image) and what I get on your example site (4th and 5th image).

Should I enter them directly in the js file (which means I will have a specific js file on each list I use the cross site column addon) ?

Coordinator
Feb 22, 2010 at 2:43 PM

Hi Jack,

Try using version 0.8 of jPoint loader instead of 0.6.1.

jPoint-0.8.zip  can be found on under downloads.

Change "Image2" "src=" from "//www.sharejPoint.com" to your local shared documents library (wherever you saved contents of jPoint-0.8.zip file.

Feb 23, 2010 at 9:04 AM
Edited Feb 23, 2010 at 9:05 AM

Hi Samir,

Changing the version of jPoint loader worked, thanks!
I get the options button now, and I can set the different options to be used.

I ran into another problem now.
When I change the option "LookUpShowDetail" into false, I get the following alert from javascript:

Example of how to set up values parameter: 'values:[{text:'test1', value:'1'}, {text:'test2', value'2'}]'

My dropdown doesn't contain any values then.
When I set it back to true, I don't get any alert, and I see my values in the dropdown along with the details box below the dropdown (but I don't want to see the details).

Seems as if he can't find the values when I set this to false ?
Any ideas on that one ?

Feb 23, 2010 at 9:18 AM
Edited Feb 23, 2010 at 9:24 AM

Pictures say more than words, so here are some screenshots:

When I set the options as this:

Image and video hosting by TinyPic

Then it works ok, and I get the dropdown as expected along with the details box:

Image and video hosting by TinyPic

But when I change LookupShowDetail to false, and I clear the LookupDetailFieldDefinition (I also tried keeping the value there, same result), then I get this:

Image and video hosting by TinyPic

I get this alert 2 times in a row (when I click "OK", I get the same alert again, when I click "OK" then, the alert is gone, but still an empty dropdown list)
I tried to load the jPart from the 0.8 zip file, same result.

Maybe it has something to do with the jPoint.converttodropdown.js file ? I couldn't find this in the 0.8 zipfile, so I'm still linking this from the example site.

When I check the source of my CEWP I have this:

<script>var myjLocalOptions={ID:'jPartCrossSiteLookup',FormFieldName:'Title',LookupSiteURL:'/',LookupListName:'LookupTest',LookupViewName:'',LookupFieldName:'LinkTitle',LookupCAML:'',LookupShowDetail:'false',LookupDetailFieldDefinition:'',CallBackFunction:''};</script>
<script type="text/javascript" src="//s-mossdev/JavaScript/jPoint-0.8/jPointLoader.js" ></script>
<script type="text/javascript" src="//www.sharejpoint.com/src/jpoint/plugins/jPoint.converttodropdown.js"></script> <script type="text/javascript" src="//s-mossdev/JavaScript/jPoint-0.8/jParts/jPart.CrossSiteLookup.js"></script>
Coordinator
Feb 23, 2010 at 3:08 PM

Updated jPart.CrossSiteLookup.js to fix this issue.  Give it a go.

 

Feb 23, 2010 at 3:15 PM

Where do I download it ?
When I download the 0.8 version the modified date of jPart.CrossSiteLookup.js is the same as the one I was using before ?

Coordinator
Feb 23, 2010 at 3:43 PM

You can download by putting the url in the address bar.  IE will prompt if you want to save the js file.

http://www.sharejpoint.com/src/jpoint/plugins/jPoint.converttodropdown.js

http://www.sharejpoint.com/src/jPoint/webparts/jPart.crossSiteLookup.js

You can also open the library on the SharejPoint site

http://www.sharejpoint.com/src    (main source library)

http://www.sharejpoint.com/src/Forms/AllItems.aspx?RootFolder=%2Fsrc%2FjPoint&View=%7b7D2936F2%2d0640%2d45D7%2d817E%2d603DA9FA2A5F%7d  (jPoint lib)

http://www.sharejpoint.com/src/Forms/AllItems.aspx?RootFolder=%2fsrc%2fjPoint%2fwebparts&FolderCTID=&View=%7b7D2936F2%2d0640%2d45D7%2d817E%2d603DA9FA2A5F%7d   (webparts lib)

Feb 24, 2010 at 7:39 AM

Hi Ken,

The new version resolves the problem.
It's fully working now.

Thanks a lot for your support on this!