Developed sample application - CalculatedComplex.zip is based on HR schema available in Oracle XE database and implements logic that allows to edit two calculated columns - MinSalary and MaxSalary.
Calculation rule applied for MinSalary:
- IF (MaxEmployeeSalary - AvgEmployeeSalary <>
- IF (AvgEmployeeSalary + MaxEmployeeSalary > MaxSalary) THEN update(MaxSalary)
MaxEmployeeSalary and AvgEmployeeSalary are values calculated in EmployeesQueryView:
Calculations for both columns are done in Backing bean, methods are invoked through dummy binding to ReadOnly property:
All calculations related to MinSalary are done in getCalculatedMinSalary() method. Based on JobId parameter are calculated AvgEmployeeSalary and MaxEmployeeSalary values, and if specified condition is satisfied MinSalary is updated:
MaxSalary is calculated in exactly the same way as MinSalary.
Now I will show how it works. Let's say we want to focus on PU_CLERK salary:
If in Employees table we set Salary values for PU_CLERK to 1900, 1600, 1700, 1600, 1500 and press Save button - MinSalary in Jobs table for PU_CLERK is updated to 240:
MaxSalary is not updated, because AvgEmployeeSalary + MaxEmployeeSalary = 3560 and this is less comparing to current 8000. So, user can set MaxSalary manually to let's say 5000 and this value will be stored in database:
When running sample application, don't forget to add adf-faces-impl.jar and jsf-impl.jar to application's WEB-INF\lib directory.
4 comments:
Hey,
I am working in ADF BC + JSF.
Its a question regarding Jdev10g. How do I dsipaly a field as a LOV (the one with a flash light icon and pops up as a new window containing 1 or more columns). I have search a lot but coul
dn't get how to implement this req.
Kindly Help..!
Hi Anu,
You can find my post - Complex List-Of-Values (LOV) in Oracle ADF useful. I'm describing there how to develop LOV's in table.
Regards,
Andrejus
Hi Andrejus
About this example:
I am new to ADF11G and did not know ADF10G. I Try do this example in ADF11g (not migrating) using backin bean as indicated, but I have this error:
javax.el.PropertyNotFoundException: The class 'view.backing.Main' does not have the property 'group1'.
at javax.el.BeanELResolver.getBeanProperty(BeanELResolver.java:547)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:249)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)
at com.sun.el.parser.AstValue.getValue(AstValue.java:118)
Truncated. see log file for complete stacktrace
I need your help please...
And .. thank you very much for publishing such good examples to help that we are embarking on ADF.
Hi,
It means, on your page you have af:group component with group1 binding. However, in Backing bean you dont have group1 object for this binding.
Regards,
Andrejus
Post a Comment