Wednesday, March 19, 2014

Using Transient Attribute on Business Components

This is very simple task, but could be useful for developers who are new to ADF. You can add a Transient attribute that is derived from other attributes or from some other data source. Here are simple steps on how to do this and how to make sure that value for Transient Attribute gets updated when other attributes are changed.

  • Create new attribute on Entity object.

  • It seems attribute is marked as persistent. So you will have to change it.

  • If you don't have Entity Java class and accessor methods, please generate it (see Java tab). Once you have get method for FullName, change as shown below.

  • Add same attribute to your View Object as well, so that you can run BC Tester.

  • As you navigate to rows, you will data change in FullName. But if you change FirstName of LastName, it is not reflected in FullName. You will need to specify Dependency on FirstName and LastName for FullName attribute as shown in next screenshot.

  •  Now as you change FirstName, you will see change in FullName immediately.

These same steps apply to View Object transient attributes also, except few minor differences.