Friday, August 10, 2012

ADF - Using Property Sets in JDeveloper

"Property Sets" are a new addition to ADF Business Components (ADF BC) in JDeveloper 11g. Property set is a nice declarative way to stop programming and doing same things to different attributes of  EOs and VOs.

In this example tutorial, we will take a look of how to use Property Set to create a tool tip for two different attributes of a EO. We will be using OE schema and will be using CUSTOMERS EO created our of CUSTOMERS table in OE schema.

Right click on the package in the Model project of the Fusion Web App.

Now click new and in ADF Business Components click Property Set and then click OK.

Specify a name for new Property Set (I gave it ToolTipPropertySet). Click ok

Click on the green button and select Non - Translatable and put in Property as "TOOLTIP" and value as "This is Sample Tool Tip" like below screenshot.

Now double click on Customers EO and click on CustFirstName. In the inspector below, click on Property Set and select the property set which we created earlier (ToolTipPropertySet).

Repeat the same thing with Address attribute of Customer EO.

Save all the files and run the ADF Business component tester.

Place you cursor or click on CustFirstName. You will see the tool tip which we set in ToolTipPropertySet.

Now again place you cursor or click on Address, you will see the same tool tip. This is because we selected ToolTipPropertySet in Property Set for Address field also.

So this is the power of Property Set. We can assign a property defined in Property Set to any attribute of EO or VO. This helps in defining properties at single place and assigning them to attributes very easily.

Hope this was helpful.

Happy Learning !!

Rohan Walia