To AutoBind or not AutoBind
If you've had a chance to play with JDeveloper 10.1.3's JSF development feature you may have noticed how page or UI component will come with auto-generated backing bean code.
For example if you create a new JSF enabled JSP page, "simple.jsp", you notice that a Java class "Simple.java" will also be created and added as a managed bean to your application. Also any subsequent drag and drops of UI Components onto your page will result in additional components such as a "HtmlInputText" being added to the backing bean class when an InputText tag is placed on the page.

1. As the component is dropped
2. Backing bean code is auto-generated and bound to the new UI Component
Here is the managed bean that was auto-generated

Also when the developer double-clicks on a component such as a CommandButton in the visual editor, additional "Action" code will be generated in the backing bean's class.

Double-clicking on the CommandButton in the Visual editor will also jump to the newly generated section of "Action" code.

How to turn off Auto-Binding
This is really cool for developers wanting a more RAD, Visual Basic type of experience, but for developers who prefer to build their own managed beans and generally shy away from auto-generated code, there is an easy option in JDeveloper which allows developers to turn off the auto-bind option.
Turning off the Auto-Bind option is done by invoking the Preference editor for the JSP HTML Visual Editor: Tools->Preferences->JSP and HTML Visual Editor and unchecking the "Auto-Bind JSF Components.." option. You'll notice though that you have to restart JDeveloper.

Your Comments Welcome!
For production we've been discussing making the option to turn-off autobinding more conspicuous such as when the first time you drop a component, JDeveloper could prompt you if you wish to auto-generate (and bind) any dropped components. This dialog could also have a checkbox to remember to do this from now on so you don't have to constantly tell it whether to auto-bind or not.
I'd be very interested in any feedback regarding this possible feature for production. Please let us know what you think on this!!!
Thanks!
7:00:08 PM
|