Tuesday Mar 30, 2010

Working with Backing Beans in JDeveloper - The Right Way

One nice feature that was in JDeveloper for a long time is the ability to automatically expose every component on your JSF page in a backing bean. While this is a nice "work saving" feature, you shouldn't be using this one in most cases.
The reason is that it will create objects in your backing bean code for a lot of items you don't actually need to manipulate, making your code bigger and more complex to maintain.

The right way of working is to expose only components you need in your backing bean - and JDeveloper makes this just as easy through the binding property in the property inspector and the edit option it has.

Here is a quick video showing you how to do that:

Friday Jul 31, 2009

Java Class Data Control and ADF Binding Tricks Demo

This demo started from a simple request on the OTN forum asking how would you go about creating a JSF page that reads and writes a file content.

The quick answer I gave was that you can do this with a simple Java class that you expose as a datacontrol. But then I started thinking there will be some more tricky parts that you'll need to do in order to get the UI and binding to work exactly as you would like. The trick is to merge the result of one operation to be the input for the other operation. I played around with the solution I provided and decided to record this since there are a few steps here that will be useful to refer people to in the future.

The "Tricky Parts" that demo shows are:
1. Creating a data control from a simple Java class
2. Binding with ADF Parameter Form to invoke methods
3. Setting the value for method's parameters using the binding tab
4. Creating a backing bean for a JSF page
5. Modifying a default ADF method in a backing bean
5. Accessing an ADF binding control value in your backing bean
6. Binding an existing JSF components to a backing bean
7. Deleting a component from a JSF page without deleting it's binding

Here is the demo:

I hope this helps.
(And sorry that I got a phone call and an IM while recording :-) )

Note - some people requested to see the actual code - you can find the completed workspace here.

About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today