Quantcast
Channel: PTC Community : Unanswered Discussions - Windchill
Viewing all articles
Browse latest Browse all 3592

Inline Item Picker - custom pickercallback issue.

$
0
0

Hi,

 

I have to customize an OOTB item picker such that it filters objects that has certain numbers. I believe this can be done by defining your own callback instead of using the default callback. I've defined a pickercallback in the same jsp (havent put it in custom.js, will this affect in any way ?). On click of 'OK' the newly defiend pickercallback is called however it cannot find the hiddenHTML elements where the oids and dispalyattr should be updated/stored.

 

Following is the picker configuration and the pickercallback:

 

<wctags:itemPicker id="baselineMemberItemPicker"

                   multiSelect="true"

                   inline="true"

                   typeComponentId="${baselineComponentId}"

                   pickerTitle="${addToBaselinePickerTitle}"

                   pickerCallback="addToBaselinePickerCallback"

                   containerRef="${containerRef}"/>

 

<script Language="JavaScript">

    function addToBaselinePickerCallback(objects, pickerID, targetId) {

    var updateHiddenField = document.getElementById(pickerID);

    var updateDisplayField = document.getElementById("baselineMemberItemPicker$label$");

   

    var myJSONObjects = objects.pickedObject;

   

    for(var i=0; i< myJSONObjects.length;i++) {

     var oid = myJSONObjects[i].oid;

     var displayAttr = eval("myJSONObjects[i].name");

     alert(displayAttr);

    updateHiddenField.value=oid;

    updateDisplayField.value=displayAttr;

     }

}

</script>

 

 

Following fields are null:

 

     var updateHiddenField = document.getElementById(pickerID);

     var updateDisplayField = document.getElementById("baselineMemberItemPicker$label$");

 

hence the selected values are not reflected on the originating UI.

 

Could you please tell what might be missing ?

 

Thanks.


Viewing all articles
Browse latest Browse all 3592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>