Monday, March 7, 2011

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);

No comments:

Post a Comment