Happy Engineer’s Day 🙂
This post is about overriding default text for select all feature in af:selectManyChoice
af:selectManyChoice supports multiple selections in ADF Faces and framework provides a default feature to select all values of the list but after selecting all value it doesn’t show values, only show a String ‘All’.
but sometimes it is not clear that what are the values by just seeing this ‘All’ text or it is a requirement to show all values (if there is not much data) instead of this default text
So in this implementation, I am using Departments table (HR Schema -Oracle) and JDeveloper 12C (12.1.3)
- Prepare model using Departments table and drop viewObject on the page as af:selectManyChoice
- Now see when we select one-two values, it appears on component but in case of all only that ‘All’ string appears
- Here I am changing this text on the valueChange event of selectManyChoice, so created a valueChangeListener in the managed bean.
- See what I am going to do in this listener is –
- Get all selected values means DepartmentId
- Next is to get corresponding DepartmentName for DepartmentId
- Add all DepartmentName into a String
- See code written in valueChangeListener , i have used enough comments to understand each line
- Run the application and check, on selecting all values it shows.
Cheers 🙂 Happy Learning
An Oracle ACE, Blogger, Reviewer, Technical Lead working on Oracle ADF