public class PartComboBoxUtility extends DefaultDataUtility {
@Override
public Object getDataValue(String component_id, Object datum, ModelContext modelContext) throws WTException {
// Initialize ComboBox UI Component
Object object = super.getDataValue(component_id, datum, modelContext);
System.out.println("component_id 111 4444 = = = = = = = "+component_id);
Object raw_value = modelContext.getRawValue();
com.ptc.core.lwc.server.PersistableAdapter nmObject= new com.ptc.core.lwc.server.PersistableAdapter (new WTPart(), null,java.util.Locale.US, null);
nmObject.load("Country");
String o=TgsPropertyHelper.getPropertyValue("Country");
String[] ab=o.split(",");
ArrayList<String> displayList = new ArrayList<String>();
ArrayList<String> internalList = new ArrayList<String>();
ArrayList<String> selectedValue = new ArrayList<String>();
internalList.addAll(Arrays.asList(ab));
displayList.addAll(Arrays.asList(ab));
selectedValue.add((String)raw_value);
ComboBox comboBox = new ComboBox(internalList,displayList,selectedValue );
if (modelContext.getDescriptorMode().equals(ComponentMode.CREATE) || modelContext.getDescriptorMode().equals(ComponentMode.EDIT))
{
comboBox.setName(component_id);
comboBox.setColumnName(AttributeDataUtilityHelper.getColumnName(component_id, datum, modelContext));
comboBox.setId(component_id);
comboBox.setInternalValues(internalList);
// comboBox.setValues(displayList);
comboBox.setEnabled(true);
return comboBox;
}
return object;
}
private String getValue(String component_id, Object datum, ModelContext mc) throws WTException {
return UtilityHelper.getStringValue(component_id, datum, mc);
}
}