Search This Blog

Sunday, June 30, 2013

OAF - Pass parameters between pages and session

OAPageContext (called from UI client)
putSessionValue( )
removeSessionValue( )
getSessionValue( )

OAPageContext (called from UI client for encryption)
PutEncryptedParameter( )
GetDecryptedParameter( )

OAPageContext (called from UI client)
putTransactionValue( )
getTransactionValue( )
removeTransactionValue( )

OADBTransaction (called from server)
putValue( )
getValue( )
removeValue( )

Format negative numbers with bracket in ADF screens.

In Financials, it is important that negative numbers are displayed/formatted within brackets or braces.

Challenge comes in when the the column or UI attribute holds both positive and negative number.

Solution : On the UI Attribute, place with pattern as "#,##,###.00;(##,##,###.00)"
Or
If the UI is based on a VO, edit the attribute properties and specify the below details as part of the Control Hints. without the double quotes formattype as "Number" and format as "#,##,###.00;(##,##,###.00)"

The key here is semi-colon(;) seperating the value of the format, ADF internally recognizes that the second format value is for negative number.

Reference scope variable in VO as bind parameter

Reference scope variable in VO as bind parameter.

Note: Accessing scope variable in VO is violation of MVC but can be performed using below groovy experssion.

adf.context.expressionEvaluator.evaluate('#{pageFlowScope.empNo}')

get ADF Logger root directory at runtime

ADFLogger logger;

logger = ADFLogger.createADFLogger(MyClass.class);

InitialContext ctx = new InitialContext();
           
MBeanServer server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");
        
ObjectName service =new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.
runtime.RuntimeServiceMBean");

ObjectName domain =(ObjectName)server.getAttribute(service, "DomainConfiguration");

rootDir = (String)server.getAttribute(domain, "RootDirectory");

logger.info("Root Dir : " + rootDir);