public class EditCDFRuleProcessor extends DefaultObjectFormProcessor {
private static final String CLASSNAME = EditCDFRuleProcessor.class.getName();
private static final Logger logger = Logger.getLogger(EditCDFRuleProcessor.class.getName());
private static final String RESOURCE = "com.ptc.netmarkets.util.utilResource";
@Override
public FormResult doOperation(NmCommandBean clientData, List<ObjectBean> objectList) throws WTException {
FormResult result = super.postProcess(clientData, objectList);
WTDocument doc = (WTDocument) clientData.getPrimaryOid().getWtRef().getObject();
Locale locale = clientData.getLocale();
Map map = clientData.getComboBox();
List<NmContext> list = clientData.getSelected();
for (NmContext context : list) {
Object obj = context.getTargetOid().getRef();
if (obj instanceof CertClassificationLink) {
CertClassificationLink link = (CertClassificationLink) obj;
String oid = link.getPersistInfo().getObjectIdentifier().getId() + "";
ArrayList values = (ArrayList) map.get(oid + "_followProductCert");
boolean followProductCert = Boolean.valueOf(values.get(0).toString());
try {
link.setFollowProductCert(followProductCert);
} catch (WTPropertyVetoException e) {
e.printStackTrace();
}
PersistenceHelper.manager.modify(link);
}
}
result.setStatus(FormProcessingStatus.SUCCESS);
result.setJavascript("popSuccess();");
result.setNextAction(FormResultAction.JAVASCRIPT);
return result;
}
@Override
protected FormResult setRefreshInfo(FormResult result, NmCommandBean cb, List<ObjectBean> objectBeans) throws WTException {
DynamicRefreshInfo dynRefrInfo = new DynamicRefreshInfo();
// old
dynRefrInfo.setLocation(cb.getActionOid());
// new
dynRefrInfo.setOid(cb.getActionOid());
dynRefrInfo.setAction(cb.DYNAMIC_UPD);
result.addDynamicRefreshInfo(dynRefrInfo);
return result;
}
}
Processor 入门教程一[处理 ComboBox]
最新推荐文章于 2023-06-09 16:09:36 发布