Alternative way to fetch VO attribute using selected in index of LOV

If you have access to the index of the selected item, then you can use value to retrieve value of any attribute of the underlying view object.

I agree that with new releases there are more direct approaches in doing so, however, depending on the business requirement, the following method may just come handy –

    public int getValue(int index){
        
        int value = 0;
        
        ViewObject vo = this.findViewObject(<View Object>);
        Row r = vo.getRowAtRangeIndex(index);
        
        try{
            value = Integer.parseInt(r.getAttribute(<Attribute Name>).toString());
        }catch(NullPointerException npe){
            value = 0;
        }
        return value;
        
    

Author- Ankit Gupta

Happy coding with Techartifact….

Vinay

I am an Oracle ACE in Oracle ADF/Webcenter. Sr Java Consultant-working on Java/J2EE/Oracle ADF/Webcenter Portal/ content and Hibernate for several years. I'm an active member of the OTN JDeveloper/Webcenter forum. Passionate about learning new technologies. I am here to share my knowledge. Give your views and suggestion on [email protected] .

More Posts - Website

Follow Me:
TwitterLinkedInGoogle PlusYouTube