Hi,
I created a pickerfield dynamically. I created a query and set the datasource to this picker field. It prompted an error:DevelopmentException: property ‘mastert$UDC.udckey’ should have Entity type.
Thank you.
PickerField field = (PickerField) componentsFactory.createComponent(PickerField.NAME);
UDCTYPE udcType = ipdetail.getUdctype();
if(udcType != null) {
String udcTypeName = udcType.getTypename();
uDCsDs.setQuery(
" select e from mastert$UDC e,mastert$UDCTYPE d where e.udctype = d.ID AND d.typename = '" + udcTypeName + "'");
String query = uDCsDs.getQuery();
field.setDatasource(uDCsDs,"udckey");
}
udckey is a field of table mastert$UDC.
If I change the property to the entity name-UDC, it showed an error:IllegalArgumentException: Could not resolve property path ‘UDC’ in ‘mastert$UDC’
PickerField field = (PickerField) componentsFactory.createComponent(PickerField.NAME);
UDCTYPE udcType = ipdetail.getUdctype();
if(udcType != null) {
String udcTypeName = udcType.getTypename();
uDCsDs.setQuery(
" select e from mastert$UDC e,mastert$UDCTYPE d where e.udctype = d.ID AND d.typename = '" + udcTypeName + "'");
String query = uDCsDs.getQuery();
field.setDatasource(uDCsDs,"UDC");
}