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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Not able to get attribute value on picker callback function from custom JSP page.

Manoj_Dokku4
11-Garnet

Not able to get attribute value on picker callback function from custom JSP page.

Hi All, I'm stuck on a problem where im not able to get the custom attribute on the picker callback, the tags and the scripts written in the jsp page is as specified below.

 

Tag written in the jsp page.

 

<wctags:itemPicker
id="pickerID"
objectType="WCTYPE|wt.doc.WTDocument|Type1|Type2"
componentId="pickerID"
searchResultsViewId="pickerID.view"
label="Submitter"
pickerTitle="Picker Title"
pickerCallback="PickerCallback1"
pickedAttributes="number,attrInternalName1,attrInternalName2,attrInternalName3"
/>

 

<script>
function PickerCallback1(objects,pickerID)
{
var myJSONObjects = objects.pickedObject;
for (var i = 0; i < myJSONObjects.length; i++) {
var str = JSON.stringify(myJSONObjects[i]);
alert(str);
var fullName = myJSONObjects[i]["attrInternalName1"];
alert(fullName);
}
}

</script>

 

Output on alert : "undefined"

 

@HelesicPetr @BjoernRueegg 

1 ACCEPTED SOLUTION

Accepted Solutions

<tr><wctags:itemPicker id="pickerid" objectType="WCTYPE|wt.doc.WTDocument|Type1|Type2" componentId="pickerid" searchResultsViewId="Picker.view" label="Submitter" pickerTitle="Customer Picker" pickerCallback="PickerCallback1" displayAttribute="number,org.CustomerName,orgCustomerNumber,org.AddressID"/></tr>

 

Picked attributes are not required, only display attributes are required.

 

This worked.

View solution in original post

3 REPLIES 3

Sorry, haven't used any custom pickers jet.

 

By the way, it would make it easier for any reader to insert code instead copy/paste text:

bmr_0-1671617656649.png

 

Thanks, noted.

<tr><wctags:itemPicker id="pickerid" objectType="WCTYPE|wt.doc.WTDocument|Type1|Type2" componentId="pickerid" searchResultsViewId="Picker.view" label="Submitter" pickerTitle="Customer Picker" pickerCallback="PickerCallback1" displayAttribute="number,org.CustomerName,orgCustomerNumber,org.AddressID"/></tr>

 

Picked attributes are not required, only display attributes are required.

 

This worked.

Top Tags