Updated: 2/23/2005; 1:46:40 PM.
Chris Schalk's J2EE Weblog
This Blog Discusses Tips and Tricks for building J2EE Web Applications with Oracle JDeveloper
        

Wednesday, January 05, 2005

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    comment []

© Copyright 2005 Chris Schalk.
 
January 2005
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Dec   Feb


Search blog with Google:
 








Click here to visit the Radio UserLand website.

Subscribe to "Chris Schalk's J2EE Weblog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.