Tuesday, March 22, 2011

Key FlexField in OAF Pages

KFF in OAF Page-Gyan

Monday, March 7, 2011

Set Focus on a Bean Dynamically

In some situation you need to set the focus on particular Bean. Below is the Code for achieving the same.

import oracle.apps.fnd.framework.webui.beans.OABodyBean;
OABodyBean oabean = (OABodyBean)pageContext.getRootWebBean();
oabean.setInitialFocusId("Item_Name");

Programmatically Adding the Fire Partical Action to a Bean

In some situations where you need to add the Fire Action (Action Type) to the Bean @runtime. Below is the code to achieve the same.

 
import oracle.cabo.ui.action.FireAction;
import oracle.cabo.ui.action.FirePartialAction;
OAMessageChoiceBean mb=(OAMessageChoiceBean)webBean.findChildRecursive("BeanId");
FireAction firePartialAction = new FirePartialAction("DelAction");
mb.setAttributeValue(PRIMARY_CLIENT_ACTION_ATTR,firePartialAction);

Set the Prompt for the Bean Programmatically

There are some situation when your page contains a web bean that does not have a prompt value associated with it.
This usually get noticed, when a user enters an invalid value for the web bean, the error message that results will be malformed.

eg: Value "TestData" in "" is not a number.
 
import oracle.apps.fnd.framework.webui.beans.message.OAMessagePromptBean;
OAMessagePromptBean bean = new OAMessagePromptBean();
bean.setID("TestID");
//Replace NewPrompt with the Prompt you want
bean.setPrompt("NewPrompt");
//Replace BeanID with the Id of the bean
bean.setLabeledNodeID("BeanID");
webBean.addIndexedChild(bean);