cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

Inline Item Picker - custom pickercallback issue.

mrane
1-Newbie

Inline Item Picker - custom pickercallback issue.

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.

1 REPLY 1
mrane
1-Newbie
(To:mrane)

HI

I tried creating those missing hidden elements, but unfortunately it doesnt work.

I haven't found a way to get this to working just yet. Does anybody on the community has an idea as to what might be missing or what could possibly be resolve this issue ?

Thanks.

Top Tags