Cascading with Display Related Info 2013.02a

Jan 15, 2014 at 3:36 PM
I am currently working on a project in SP 2010 that is requiring dynamic cascading dropdowns in addition to showing information on two out of three selections made. I have successfully got the dynamic cascading dropdowns to work as intended by itself. However when I add in the display related info functionality I start to have issues.

First dropdown selection is a lookup column from ListA to allow selection of a main category.

Second dropdown is looking at the First, and providing a selection of questions from ListB with relation to the category.

Third dropdown is looking at the Second, and providing a selection of answers from ListC with relation to the question.

The desired use of the display related info is to show the full text of the question selected and the full text of the answer selected. The reason for this is that the questions/answers full text is large and has potential to change based on business needs, but the question/answer selections do not.

Below is my current code. with it as is, the first two dropdowns and first display related information works fine. However, the third dropdown returns (None) and as a result does not display any related information. If I remove the display related info functions, the dropdowns work as inteded.
<script language="javascript" src="/sites/SiteAssets/DynamicForms/jquery-1.10.2.min.js" type="text/javascript"></script><script language="javascript" src="/sites/SiteAssets/jquery.SPServices-2013.02a.min.js" type="text/javascript"></script><script type="text/javascript">

$(document).ready(function() {
    $().SPServices.SPCascadeDropdowns({
        async: false,
        relationshipList: "{xxx-xxx-xxx-xxx-xxxx}",
        relationshipListParentColumn: "FunctionKey_Feeder",
        relationshipListChildColumn: "QuestionRef",
        parentColumn: "Process",
        childColumn: "Question",
    });
        $().SPServices.SPDisplayRelatedInfo({
        async: false,
        columnName: "Question",
        relatedList: "{xxx-xxx-xxx-xxx-xxxx}",
        relatedListColumn: "QuestionRef",
        relatedColumns: ["FullText"],
        displayFormat: "list",
        // headerCSSClass: "ms-hidden",
    });
    $().SPServices.SPCascadeDropdowns({
        async: false,
        relationshipList: "{xxx-xxx-xxx-xxx-xxxx}",
        relationshipListParentColumn: "QuestionRef",
        relationshipListChildColumn: "AnswerRef",
        parentColumn: "Question",
        childColumn: "Answer",
    });
    $().SPServices.SPDisplayRelatedInfo({
        async: false,
        columnName: "Answer",
        relatedList: "{xxx-xxx-xxx-xxx-xxxx}",
        relatedListColumn: "AnswerRef",
        relatedColumns: ["AnswerFullText"],
        displayFormat: "list",
        // headerCSSClass: "ms-hidden",
        debug: true,
    });
    
});</script>
Jan 27, 2014 at 4:59 PM
Any Ideas on this? My project is currently in a holding pattern while I try to figure this out. I have been unsuccessful in getting this to work.

Thank you for your time.
Jan 27, 2014 at 8:22 PM
Marc will need to comment if he sees any issue with CascadeDropdowns and SPDIsplyaRelatedInfo working off the same fields... I thinking that's valid and probably supported, but not sure.

One think I do notice from your markup is that you have extra commas on your input param objects. The last option to be defined should NOT have a comma at the end... IE specifically does not like that and usually throws exceptions.

So from the code above, remove the comma from:
  1. childColumn: "Question",
  2. displayFormat: "list",
  3. childColumn: "Answer",
  4. debug: true,
This might not be the root cause of your problem... If it is not, look in the browser console and check for any errors. In the long run you may have to step through the code in the interactive debugger and try to see what's going on.

/Paul.
Jan 28, 2014 at 9:02 PM
Paul,

Thank you for the response and suggestion.

After removing the comma's, it appeared that the issue is still present. However, out of pure coincedence, I had the page open for a couple minutes and was reviewing it with a business partner and noticed that after a couple minutes the functionality worked.

Based on this finding I have spent the last 24hrs trying to determine if it is a set time for the third and final drop down to work (thinking that maybe its a built in refresh time or something), but I have yet to be able to come up with any consistent time that it takes for the dropdown to work. When it works, it works as intended with the display related info. But it could work within 30 seconds of making a selection in the second dropdown, to well over 5 minutes before it works, and on other pc's accessing the site it not working at all.

I'm still pretty new to SharePoint/SPServices, so please excuse my lack of understanding on this. Is there a function that I should be adding to be run after the selection is made on the dropdown that refreshes the data?

Thanks again for the response and help.
Jan 29, 2014 at 1:08 AM
That's very strange. Could it be that your lists have allot of data? That could cause these dropdown to take a while.

Aside from that, it's hard to tell what's going on. You would have to really dig in and try to understand were the bottleneck is.


Marc,
Just thinking here. I have not looked at the code for the SPDisplayRelatedInfo, but do you remember whether the calls for data are synchronous? I think SPCascadeDropdown is.
I don't envision that utility to be an issue, but again I have not looked.


--
Paul T.

-- Sent from Mobile