Create a new update-able transient attribute say ManagerName in the EmployeesView.
Create a new read-only VO to fetch manager name and id
Add the manager LOV on ManagerName attribute. Make mappings to return ManagerName and ManagerId. Make List Type as "Input Text with List of Values"
Now the important step: In the EmployeesViewRowImpl add the following code to getManagerName() method:
public String getmanagerName() {
Object mgrId = getAttributeInternal(MANAGERID);
String managerName = null;
System.out.println("-----------1-----------");
if(mgrId != null) {
Object[] obj = {mgrId};
Key key = new Key(obj);
Row[] rows = getmanagerVO1().findByKey(key, 1);
System.out.println("-----------2-----------");
if(rows != null && rows.length > 0) {
managerName = (String)rows[0].getAttribute(1);
System.out.println("-----------"+ managerName + "----------");
}
}
System.out.println("-----------4-----------");
return managerName;
}
否则为空:
The above code basically gets the ManagerName from the Manager LOV for the current ManagerId.
Now when we drop the EmployeesView on page it creates a LOV for ManagerName. Set AutoSubmit = true to make show LOV window on tab out.
Just for display I have also added ManagerId column on page. Add partialTrigger to point to ManagerName column.
Run the page to test the application.