How to conditionally set data as editable based on another fields value

This question comes up a few times in ADF land and it appeared on the OTN forums this week so I thought I would create a quick demo.  The scenario is that depending on some data value, you want to define that some other data is not editable.  For example, if an order status is "CANCELLED" then the order cannot be edited.

Now, you might be thinking that you could use some sort of UI functionality here; maybe an EL which checks the value of a field and sets a property or switcher to show non-editable fields.  You could, but if you think about it, this is fundementally a business logic problem - regardless of how the UI looks, a cancelled order should not be editable.  Its actually quite a simple piece of code you can put in ADF Business Components.

The trick is that for every attribute in a View Object or Entity Object, a framework method isAttributeUpdateable is called to check if this attribute can be updated.  So, its pretty easy to override this method to add your own check. 

This will appear as an ADF Insider Essentials this week and is already available on YouTube as well.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips, Tricks, Events and Information around Oracle JDeveloper, ADF, and Oracle Forms

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
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
    
       
Today