Like mentioned in a previous post, I was new to ADF at the time so this one took me a while to figure out but now it looks really simple. Here are the Utility Methods I wrote to help with this.
Getting the Data Control Value:
public static String getDataControlFieldValue(String fieldValue) {
try {
BindingContainer attributeBindings = BindingContext.getCurrent().getCurrentBindingsEntry();
List<AttributeBinding> attributeBindingList = attributeBindings.getAttributeBindings();
for (AttributeBinding attributeBinding : attributeBindingList) {//Checking if this Assessment is New or Saved, if Null this Assessment is New
if (attributeBinding.getName() == fieldValue) {
if (attributeBinding.getInputValue() != null &&
StringUtils.isBlank(attributeBinding.getInputValue().toString()) != true) {
return attributeBinding.getInputValue().toString();
} else {
return null;
}
}
}
} catch (Exception exception) {
System.out.println(“Nothing found in BPM to Load!”);
return null;
}
return null;
}
Setting the Data Control Value:
public static void setDataControlFieldValue(String fieldValue, String value) {
BindingContainer attributeBindings = BindingContext.getCurrent().getCurrentBindingsEntry();
List<AttributeBinding> attributeBindingList = attributeBindings.getAttributeBindings();
for (AttributeBinding attributeBinding : attributeBindingList) {//Checking if this Assessment is New or Saved, if Null this Assessment is New
if (attributeBinding.getName() == fieldValue) {
attributeBinding.setInputValue(value);
}
}
}