How-to get the binding for a tab in the Dynamic Tab Shell Template

Posted by Frank Nimphius on Oracle Blogs See other posts from Oracle Blogs or by Frank Nimphius
Published on Sun, 7 Oct 2012 04:37:08 +0000 Indexed on 2012/10/07 9:45 UTC
Read the original article Hit count: 309

Filed under:

The Dynamic Tab Shell template does expose a method on the Tab.java class that allows you to get access to the ADF binding container for a tab. At least in theory this works, because in practice this call always returns a null value (a bug is filed for this).

To work around the problem, you can use code similar to the following to get the ADF binding for a specific tab

DCBindingContainer currentBinding = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
DCBindingContainer templateBinding = (DCBindingContainer)currentBinding.get("ptb1");
DCBindingContainer tabBinding= (DCBindingContainer)templateBinding.get("r"+0); 

 In the code line above, the tabBinding variable will hold the binding reference to the first tab in the dynamic tab shell template. Note that the tab doesn't need to be visible for this (which has to do with how the template works).

 "ptb1" is the template reference name in the PageDef file (Executable section) of the template consumer view. Check this string in your page before using this code. If it differs, change it also in the code above.

"r0" is the binding reference of the first tab in the template. Te last tab is referenced by "r14".

 

© Oracle Blogs or respective owner

Related posts about /Oracle/ADFv