Friday, February 24, 2017

OAF- How to get Segment values from KFF


Following is the code snippt, which can be used to get segment values from the selected KFF.


///Below is the PFR Code on Save button

         OAKeyFlexBean kffbean= (OAKeyFlexBean)webBean.findIndexedChildRecursive("kffID");     //Get the KFF bean

         KeyFlexfield kff=(KeyFlexfield)kffbean.getAttributeValue(OAWebBeanConstants.FLEXFIELD_REFERENCE);       //Getting the Reference Value
         if(kff!=null){
             if(kff.getSegment(1).getValue()!=null)
             {
                     String value = kff.getSegment(1).getValue().toString();    //This returns Value object so we can just see a object
                     String name = kff.getSegment(1).getName();                 // This returns the Segment name attached
                     String inputValue = kff.getSegment(1).getInputValue();       // This returns the Segment value when user gives as input
                    
                     System.out.println("Value -->"+ value);
                 System.out.println("name -->"+ name);
                 System.out.println("inputValue -->"+ inputValue);
             }
         }



 

1 comment:

Sivabalan said...

Hi Sridhar,

I have the "java:64: error: cannot find symbol" error for the following line.

KeyFlexfield kff=(KeyFlexfield)kffbean.getAttributeValue(OAWebBeanConstants.FLEXFIELD_REFERENCE);

Please tell me what the mandatory classes to be imported for this.

Regards,
Siva