use the following snippet to get the current binding
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry(); AttributeBinding at = (AttributeBinding)bindings.getControlBinding("Period"); at.getInputValue();
The above mentioned code is useful only in case of retrieving values of any attribute binding in the page definition file. To retrieve specific information use it like
//For search binding use it like FacesCtrlSearchBinding fc = (FacesCtrlSearchBinding)bindings.findExecutableBinding("PeriodQuery"); or FacesCtrlSearchBinding fc = (FacesCtrlSearchBinding)bindings.get("PeriodQuery"); //For LOV binding use it like FacesCtrlLOVBinding fc = (FacesCtrlLOVBinding)bindings.get("PeriodLOV");
some of the useful methods that can also be used for retrieving binding is
private BindingContainer getBindings() { BindingContainer bindings = (BindingContainer)fc.getApplication().evaluateExpressionGet(fc, "#{bindings}", BindingContainer.class); return (bindings == null) ? null : bindings; }
to retrieve the bindings or executable you use it like
//to retireve the tree/table bindings FacesCtrlHierBinding fc = (FacesCtrlHierBinding)bindings.get("Period"); //to retireve the tree/table iterator DCIteratorBinding dc = (DCIteratorBinding)bindings.get("PeriodIterator");
This line
return (bindings == null) ? bindings : null;
deserves some attention 🙂
Hey thanks for pointing out
Or simply
return bindings;
yes that is always going to be returning a binding but its better to have a check as part of good coding standard.
Hi,
Thnks for this info.
I have put a note on the OTN regarding an internal API used here http://forums.oracle.com/forums/thread.jspa?messageID=9712219#9712219
Can you cross check if this ?
thnks
Hi Andrejus,I get the same error but my case is a lot different.I ceertad a simple(No Security enabled) jspx page in JDeveloper 11g and it works really perfect on pc browsers.I get that error whenever I want to load that page on my mobile emulator browser!!! It doesn’t work even on real mobile browsers like iphone Safari.Any suggestions?Thanks,Shahab