This post talks about how to display hierarchical dropdown in selectOneChoice.
There is one method explained by Frank
here. Well this method show two levels in hierarchical dropdown using two af:ForEach iteration.
What if we have multiple level, and don't know how many af:forEach would be required. Other approach is to achieve required spaces through query to show dropdown structure. Thanks to my friend
Prahlad for sharing this.
In below query, emp_disp will have appropriate spaces based on the level of the employee in the employee hierarchy.
select LEVEL,FIRST_NAME,LAST_NAME,
LPAD(FIRST_NAME ||' '|| LAST_NAME,length(FIRST_NAME ||' '|| LAST_NAME)+(LEVEL-1)*4,unistr('\00A0\00A0\00A0\00A0')) emp_disp
from EMPLOYEES
start with MANAGER_ID is null
connect by prior EMPLOYEE_ID = MANAGER_ID;
All you need to do is create a VO with above sample query and use this for dropdown.
Sample is uploaded
here..
Enjoy.