Question

I am new working with ADF and Business component I have a table with a columm with the department ID. This table is filled from another JSF page I want to show the department name instead of the department Id I have Business component with the view from my department table. But I dont know how to show the department name instead de id in the adf table My adf table is read only

Was it helpful?

Solution

you can create an LOV.Here you can select the type of attribute you need to display for the user externally(DNAME in your case) and type of value you need to store internally(DNO in your case) depending on the selected display value by the user.

Refer this link for LOV creation
http://techblogoracle.wordpress.com/2013/10/14/how-to-create-list-of-values-lov-in-oracle-adf/

OTHER TIPS

Create a LOV in your VO for that property! Then you have two possibilities: 1- Reinsert your table in your page 2- Insert (re-insert) only the attribute that you need as a read-only column in that table!

To display the name of a department instead of the departmentId, create an LOV on the departmentId attribute in the view object that the ADF table is based on, pointing to the department view object.

To update your existing read-only table, remove the departmentId attribute from the JSF, and re-add it. Make sure that the new attribute is an "ADF select one choice." After the column has been added, select the select one choice drop down, and change the read-only attribute to true.

<af:selectOneChoice value="#{row.bindings.DepartmentId.inputValue}"
                            label="#{row.bindings.DepartmentId.label}"
                            required="#{bindings.Employees_VO1.hints.DepartmentId.mandatory}"
                            shortDesc="#{bindings.Employees_VO1.hints.DepartmentId.tooltip}"
                            id="soc1" readOnly="true">

If you run this page now, it should display the name of the department, instead of the id, while still being read-only.

How to show departmentName instead of departmentId using an LOV - ADF

If you're in the same taskflow or you share Data Controls and you don't want to change your VO to be based on two EOs, you can add a Transient attribute with the name, you will populate the value in the page that fills the data.

Using LOVs it's too much of a headache. If the LOV list is big you will have performance issues that you introduce trying to solve a problem in a wrong way.

You can add referenced attributes to your VO. So create a VO that is based on Emp and Dept together. For example see the video here: https://blogs.oracle.com/shay/entry/whenvalidateitem_trigger_in_ad

use lov or use groovy Expression if number of values is not more than 2 or 3 values

usage : #{row.code eq 'A' ? 'Approved' : 'Rejected' }

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top