Form Value in OAF

Whenever there are instances that a value has to be used in an OAF page but the same value is not supposed to be displayed to the end-user, we have to make use of formValue bean.

In Oracle Apps Framework the formValue bean is used to store a value that will be submitted with a form, but the key point to mention is that value is not displayed to the user.

I assume that the creation and mapping of formValueBean’s “ViewName” and formValueBean’s “ViewAttribute” property has already been done at design time as follows.

Id of formValueBean: xxTrialFormValueBean
Name of VO: xxTrialVO
VOAttribute: xxTrialVOAttribute

As soon as that View Object is executed the formValue get’s the value of the mapped attribute.

Now, suppose you want to get the value that has been set to the formValue we can have the following steps.

1. Import the formValueBean in Controller (xxTrailCO)

import oracle.apps,fnd.framework.webui.beans.form.OAFormValueBean;

2. Create handle of the formValueBean

OAFormValueBean xxTrialFormValueBeanHandle = (OAFormValueBean)webBean.findChildRecursive(xxTrialFormValueBean);

3. getValue from the formValueBeanHandle by converting the same to String

String xxTrialFormValueString = xxTrialFormValueBeanHandle.getValue(pageContext);

Now, you can use this value as per your business logic.
Thanks for Reading

Tagged , , , , . Bookmark the permalink.