Skip to content

Instantly share code, notes, and snippets.

@shout-poor
Created December 16, 2012 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shout-poor/4309741 to your computer and use it in GitHub Desktop.
Save shout-poor/4309741 to your computer and use it in GitHub Desktop.
Oracle ADF: A method to get a VO from backing bean.
public ViewObject getViewObject(String bindingName) {
BindingContext ctx = BindingContext.getCurrent();
ControlBinding b =
ctx.getCurrentBindingsEntry().getControlBinding(bindingName);
if (b == null) {
throw new IllegalArgumentException(bindingName + " is not found.");
}
if (! (b instanceof DCControlBinding)) {
throw new IllegalArgumentException(bindingName + " is not DCControlBinding.");
}
return ((DCControlBinding)b).getViewObject();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment