X

Shay Shmeltzer's Oracle Development Tools Tips

  • January 28, 2009

When-Validate-Item trigger in ADF with PPR

Shay Shmeltzer
Director of Product Management - Oracle

Here's a common thing that many Forms developers who move to ADF run into - you have a field that is a code and you want to display the translation of the code in the field next to it when the code is entered. In forms you use the when-validate-item trigger to do this usually.

Well in ADF one way to do it is to define a view object that is based on the Entity object of both the core and code tables. For example a VO that is based on Employees as the updateable EO and on Departments as a reference EO that is used to translate the deptId in the Employee table.

Once you did this - you want to add the ability in your JSF ADF page to populate the description field with the department name once someone fills out the departmentId.

Here is a quick demo of how you would do this - it's a very basic partial page rendering technique:

[update 2013 - there is an even simpler way to do PPR see here.]

If you are reading this blog there is a good chance that you might be interested to learn about the LOV feature of ADF - might make for a better UI. See these entries: cascading LOVs,LOVs for parameters, and part two of the above solution where you can type the description and get the code.

Join the discussion

Comments ( 6 )
  • Shriram Saturday, January 31, 2009
    Very Nice demo and all the instruction expalined very well.
    Thanks
    Sr
  • guest Monday, August 22, 2011

    Hi Shay,

    Do you still have the demo url for this blog please?

    Thanks


  • Shay Monday, August 22, 2011

    guest - thanks for reminding me - I re-recorded the demo and now you have a new version.


  • guest Monday, August 22, 2011

    Thanks Shay.

    In the above demo can you make the dept name as the enterable one and to populate the deptid on employee table based on that please? The issue is the dept name cannot be enterable one. That will be useful if you could show how?


  • Shay Thursday, August 25, 2011

    guest - for the reverse work where you enter the name instead of the code see this entry: http://blogs.oracle.com/shay/entry/finding_a_code_by_typing


  • guest Thursday, August 25, 2011

    Hi Shey,

    Thanks for sharing all these nice tips.

    I’ve seen another way to achieve the same thing in an ADF Insider Video (LOV Switcher), Where F.Nimphius used a Groovy expression and a custom method in the “ViewObjectImpl” class

    http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/ADF_Insider_Essentials/lov-switcher/lov-switcher.html

    Something like “adf.source.getApplicationModule().findViewObject("DepartmentsView").getDepartmentName(DepartmentId)”

    Grant Ronald wrote another way to achieve this using Groovy

    http://blogs.oracle.com/grantronald/entry/using_groovy_to_read_values

    Something like

    “DeptView.findByKey(key(DepartmentId),1)[0].DepartmentName”

    I just want to know what is the best solution and why ?

    Thanks for your help.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.