Sudhakar Mani
Published on 27 May 2009
Hits: 2574
Recently I had this requirement to set the DFF segment to required programatically.Though it is not straight forward but with little tweaking I am able to achieve the functionality.Below code consisits of two sections,one is to print the child names under the DFF region and the second one is to get the handle of the each segment bean to set the required property.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
import java.util.Enumeration; import oracle.apps.fnd.framework.OAException; import oracle.apps.fnd.framework.server.OADBTransaction; import oracle.apps.fnd.framework.webui.OAControllerImpl; import oracle.apps.fnd.framework.webui.OAPageContext; import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean; import oracle.apps.fnd.framework.webui.beans.OAWebBean; import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean; import oracle.cabo.ui.RenderingContext; //Below is the code written inside process request method OADescriptiveFlexBean oaDFF = (OADescriptiveFlexBean)webBean.findChildRecursive("addressFlex"); oaDFF.processFlex(pageContext); // This part of the code will print all the named children below DFF Bean RenderingContext con = (RenderingContext) pageContext.getRenderingContext(); StringBuffer buf = new StringBuffer("Params: "); Enumeration enumer = oaDFF.getChildNames(con); String key = ""; while ( enumer.hasMoreElements() ) { key = (String) enumer.nextElement(); if( key != null) { buf.append("--"+ key+ ":" ); } } // This part of the code will set the segment 1 to not required OAMessageTextInputBean addressSegment1 = (OAMessageTextInputBean)oaDFF.findChildRecursive("addressFlex1"); addressSegment1.setRequired("no"); throw new OAException(buf.toString(),OAException.INFORMATION);
|