Can there be multiple SPDisplayRelatedInfo in a single page

Mar 16, 2011 at 1:51 AM
Edited Mar 16, 2011 at 2:00 AM

Hello,

    I could successfully have multiple SPCascadeDropdowns in one page.

    However, multiple SPDisplayRelatedInfo are not working. The fist SPDisplayRelatedInfo [one on the top] works. Even if I flip the sequence, each of the SPDisplayRelatedInfos in this page work when it is on the top.

    Could someone shed some light?

    Thanks.


<script type="text/javascript">
    $(document).ready(function() {
        $().SPServices.SPCascadeDropdowns({
            relationshipList: "Customer Sites",
            relationshipListParentColumn: "Customer",
            relationshipListChildColumn: "Site",
            relationshipListSortColumn: "Site",
            parentColumn: "Customer First & Last Name",
            childColumn: "Customer Site"
        });
        
         $().SPServices.SPCascadeDropdowns({
            relationshipList: "Product Serial Numbers",
            relationshipListParentColumn: "Product",
            relationshipListChildColumn: "Title",
            relationshipListSortColumn: "Title",
            parentColumn: "Product",
            childColumn: "Device S/N"
        });
 
    	$().SPServices.SPDisplayRelatedInfo({    
			columnName: "Customer Site",
			relatedList: "Sites",
			relatedListColumn: "Title",
			relatedColumns: ["Address_x0020_1", "Address_x0020_2", "City", "State", "Postal_x0020_Code"],
			displayFormat: "list",
			headerCSSClass: "ms-hidden",
            rowCSSClass:"ms-hidden",
			completefunc: SetSiteFields
		});
 
 		$().SPServices.SPDisplayRelatedInfo({    
			columnName: "Part Number 1",
			relatedList: "Parts",
			relatedListColumn: "Title",
			relatedColumns: ["Description"],
			displayFormat: "list",
			headerCSSClass: "ms-hidden",
            rowCSSClass:"ms-hidden",
			completefunc: SetPartNumber1Fields
		});
 
		$().SPServices.SPDisplayRelatedInfo({    
			columnName: "Part Number 2",
			relatedList: "Parts",
			relatedListColumn: "Title",
			relatedColumns: ["Description"],
			displayFormat: "list",
			headerCSSClass: "ms-hidden",
            rowCSSClass:"ms-hidden",
			completefunc: SetPartNumber2Fields,
			debug: true
		});
 
............

Coordinator
Mar 16, 2011 at 2:56 AM

jaijavan:

I have multiple instances of SPDisplayRelatedInfo on the same page working in my test environment, so I know that it *can* work.

I notice that you are using ms-hidden for both the header and row classes. You won't see anything then, but I assume you're doing something in the completefuncs. Have you tried commenting out the CSS classes and the completefuncs to see if it works?

M.

Mar 16, 2011 at 3:19 PM

I had removed the CSS and checked. I get no data displayed except for the first one. It works only when is it on the top.

If you say it works, I will check again.

Thanks.

Coordinator
Mar 16, 2011 at 3:24 PM

I can't spot anything else in your code that would be a problem, but missing commas and semicolons are so often the issue.

M.

Mar 17, 2011 at 3:24 AM
Edited Mar 17, 2011 at 3:55 AM

BTW, I see same behavior of the SPDisplayRelatedInfo with the latest SPServices 0.6.0 and jquery 1.4.2 to 1.5.1.

Thanks.

Mar 17, 2011 at 4:46 AM

This is fixed.....In my completefunc(), I had some NULL objects. Once I fixed those, it worked.

Thanks.

Coordinator
Mar 17, 2011 at 10:57 AM
jaijavan:

Great! And a sigh of relief that it wasn't a bug on my end.

M.
Sep 1, 2011 at 1:39 AM

Is it possible to have multiple instances that use the same columnName? I tried (in 2010) but its only displaying the first instance.


    $(document).ready(function() {

        $().SPServices.SPDisplayRelatedInfo({
            columnName: "VM Name",
            relatedList: "{60542949-3ED5-4C9A-BDB2-C243DEDADF30}",
            relatedListColumn: "Title",
            relatedColumns: ["LOCATION"],
            displayFormat: "list",
            numChars: 5,
            debug: true
        });

        $().SPServices.SPDisplayRelatedInfo({
            columnName: "VM Name",
            relatedList: "{80609F68-E0A1-4A75-A034-AC1A870E8BBC}",
            relatedListColumn: "CD_x0020_Number2",
            relatedColumns: ["Title"],
            displayFormat: "list",
            numChars: 5,
            debug: true
        });

    });

Coordinator
Sep 1, 2011 at 7:40 PM

Yes, you can have multiple instances of SPDisplayRelatedInfo, but not on the same column, as you are attempting above.

M.

Sep 1, 2011 at 7:58 PM

Any ideas of a way I could make this happen? I have data in two different lists that I need to gather that key off the same column name. Any help is greatly appreciated.

 

Colin

Coordinator
Sep 1, 2011 at 8:00 PM

I think the only way to get that working would be to clone my function and adapt it to your needs.

M.