Quantcast
Channel: PTC Community : Unanswered Discussions - Windchill
Viewing all articles
Browse latest Browse all 3592

I have created a ComboBox for a soft attribute of WTPart in the create new page. I have done this using data utility.It is showing me the values correctly in the UI screen of Create New WTPart. But the selected value is not getting persisted. Can someone

$
0
0

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);
}

}


Viewing all articles
Browse latest Browse all 3592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>