0

I'm having problems using both SPCascadeDropdowns and SPSetMultiSelectSizes on an initial display of an Editform.

The SPCascadeDropdowns works fine on its own. The parentColumn value (Listkey in my example) is a choice select field. The SPCascadeDropdowns is populating a multichoice selection value for the childColumn (ListChild in my example).

However, if I add in the SPSetMultiSelectSizes immediately after the SPCascadeDropdowns, the width of the boxes is 1, even through there is content within the childColumn field.

<input id="ListChild_.........._MultiLookup_initial" type="hidden" value="5|tReview ..............">

Note that this error only occurs on the initial display of the Editform. If I subsequently change the value of ListKey, then the SPSetMultiSelectSizes works correctly.

Has anyone come across this error, and is there a workaround?

Can I simulate a select event on the listkey field to make it work on the initial page load?

Sample code is here:

$().SPServices.SPCascadeDropdowns({
    relationshipList: "RelationshipTable",
    relationshipListParentColumn: "RelKey",
    relationshipListChildColumn: "RelChild",
    parentColumn: "ListKey",
    childColumn: "ListChild",
    debug: true
});


   $().SPServices.SPSetMultiSelectSizes({
       multiSelectColumn: "ListChild"
        });

The HTML that is generated is:

<span dir="none"><input id="ListChild_55....ce_MultiLookup" type="hidden" value="5|tReview|t6|tPreparation|t1|tComplete|t2|tCheck 2|t3|tCheck 3">
<input id="ListChild_55...ce_MultiLookup_data" type="hidden" value="5|tReview|t |t |t6|tPreparation|t |t |t1|tComplete|t |t |t2|tCheck 2|t |t |t3|tCheck 3|t |t |t">
<input id="ListChild_55....ce_MultiLookup_initial" type="hidden" value="5|tReview|t6|tPreparation|t1|tComplete|t2|tCheck 2|t3|tCheck 3">
<table class="ms-long" id="ListChild_55....ce_MultiLookup_topTable" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="ms-input" style="width: 3px;">
<select title="ListChild possible values" id="ListChild_55....ce_SelectCandidate" style="width: 3px; height: 125px; overflow: scroll;" multiple="multiple"></select></td>
<td style="padding-left: 10px;"><td align="center" class="ms-input ms-noWrap" valign="middle"><input class="ms-ButtonHeightWidth" id="ListChild_55....ce_AddButton" type="button" value="Add >"><br><br><input disabled="" class="ms-ButtonHeightWidth" id="ListChild_55....ce_RemoveButton" type="button" value="< Remove"></td>
<td style="padding-left: 10px;"><td class="ms-input" style="width: 3px;"><select title="ListChild selected values" id="ListChild_55....ce_SelectResult" style="width: 3px; height: 125px; overflow: scroll;" multiple="multiple"><option title="Review" value="5">Review</option><option title="Preparation" value="6">Preparation</option><option title="Complete" value="1">Complete</option><option title="Check 2" value="2">Check 2</option><option title="Check 3" value="3">Check 3</option></select></td></tr></tbody></table></span>

1 Answer 1

0

Found the issue. My Editform has several tabs on it. If the tab that holds the "ListChild" is not immediately visible on entering the form then the field will not be properly formatted by SPSetMultiSelectSizes.

Solution: Changed the initial visible tab to be the one that contains the ListChild field and then it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.