Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Solved! Go to Solution.
Hello Petr,
Apologies. it was resolved by clearing browser cache as due to cached windchill-all.js, still non latest version was being referred, causing the error.
1. created a java utility with reference to custom callback.
HashMap<String, Object> customProps = new HashMap<String, Object>();
if ("internalnameofcustomAttribute".equalsIgnoreCase(component_id))
customProps.put("pickerId",component_id);
customProps.put("pickerCallback", "CustomPickerInputComponentCallback");
2. the custom callback is defined in custom.jsfrag
function CustomPickerInputComponentCallback(objects,pickerID,attr,displayFieldId)
{
var updateHiddenField=document.getElementsByName(pickerID)[0];
var updateDisplayField=document.getElementsByName(displayFieldId)[0];
if(updateDisplayField)
{
PTC.util._setMainFormStartingElement(updateDisplayField);
}
var myJSONObjects=objects.pickedObject;
for(var i=0;i<myJSONObjects.length;i++)
{var oid=myJSONObjects[i].oid;
var displayAttr=myJSONObjects[i][attr];
updateHiddenField.value=displayAttr;
updateDisplayField.value=displayAttr;
}
}
Hi @SL_10932999
Did you define the callback in your code?
something like
customProps.put("pickerCallback", "CustomPickerInputComponentCallback");
if so, have you defined this as a js script in your jsp page? so it can be called from jsp?
Example:
PetrH
Hello Petr,
Apologies. it was resolved by clearing browser cache as due to cached windchill-all.js, still non latest version was being referred, causing the error.
1. created a java utility with reference to custom callback.
HashMap<String, Object> customProps = new HashMap<String, Object>();
if ("internalnameofcustomAttribute".equalsIgnoreCase(component_id))
customProps.put("pickerId",component_id);
customProps.put("pickerCallback", "CustomPickerInputComponentCallback");
2. the custom callback is defined in custom.jsfrag
function CustomPickerInputComponentCallback(objects,pickerID,attr,displayFieldId)
{
var updateHiddenField=document.getElementsByName(pickerID)[0];
var updateDisplayField=document.getElementsByName(displayFieldId)[0];
if(updateDisplayField)
{
PTC.util._setMainFormStartingElement(updateDisplayField);
}
var myJSONObjects=objects.pickedObject;
for(var i=0;i<myJSONObjects.length;i++)
{var oid=myJSONObjects[i].oid;
var displayAttr=myJSONObjects[i][attr];
updateHiddenField.value=displayAttr;
updateDisplayField.value=displayAttr;
}
}