Thursday 21 January 2016



package xxclt.oracle.apps.irc.vacancy.webui;

import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.OAWebBeanUtils;
import oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageCheckBoxBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovChoiceBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean;
import oracle.apps.irc.vacancy.webui.VacNewDetsPageCO;
import oracle.cabo.ui.action.FireAction;
import oracle.jbo.ViewObject;


public class XXVacNewDetsPageCO extends VacNewDetsPageCO {
public XXVacNewDetsPageCO() {
}

public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
super.processRequest(pageContext, webBean);
OADescriptiveFlexBean dffBean =
(OADescriptiveFlexBean)webBean.findIndexedChildRecursive("FndFlexField");
dffBean.processFlex(pageContext);
OAMessageChoiceBean segment1 =
(OAMessageChoiceBean)dffBean.findChildRecursive("FndFlexField0");
segment1.setRequired("yes");
segment1.setFireActionForSubmit ("selectBCN",null, null,true, true);

}

public void processFormRequest(OAPageContext pageContext,
OAWebBean webBean) {
super.processFormRequest(pageContext, webBean);

if ("selectBCN".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM))) {
// The Position poplist PPR change event has fired.
OAApplicationModule am = pageContext.getRootApplicationModule();
String vStatus;
OADescriptiveFlexBean dffBean =
(OADescriptiveFlexBean)webBean.findIndexedChildRecursive("FndFlexField");
dffBean.processFlex(pageContext);
OAMessageChoiceBean bcnSegment =
(OAMessageChoiceBean)dffBean.findChildRecursive("FndFlexField0");
String vBCNValue = bcnSegment.getSelectionValue(pageContext) ;
pageContext.writeDiagnostics("XXCLIENT",vBCNValue,1);
String vacancyInfoQuery =
"SELECT bcn, grade, job_title, vacancy_type, ORGANIZATION FROM xxclt_mbd_bcn_info_v";

//Specify the Where Clause for the same
vacancyInfoQuery = vacancyInfoQuery + " WHERE bcn = :1 ";

//First see if this VO is already attached to view object
ViewObject vacancyInfoVO = am.findViewObject("XXVvacancyInfoVO");
if (vacancyInfoVO == null)
vacancyInfoVO =
am.createViewObjectFromQueryStmt("XXVvacancyInfoVO",
vacancyInfoQuery);
//By now we are sure that the view object exists
vacancyInfoVO.setWhereClauseParams(null);
//Set the where clause
vacancyInfoVO.setWhereClauseParam(0, vBCNValue);
vacancyInfoVO.executeQuery();
oracle.jbo.Row row = vacancyInfoVO.first();
//get the value of description column from View Object record returned
String vGrade = "";
String vJobTitle = "";
String vVacancyType = "";
String vOrganization = "";

if (row != null) {
vGrade = row.getAttribute(1).toString();
vJobTitle = row.getAttribute(2).toString();
vVacancyType = row.getAttribute(3).toString();
vOrganization = row.getAttribute(4).toString();
}

OAMessageLovInputBean vGradeBean =
(OAMessageLovInputBean)webBean.findChildRecursive("FndGrade");
OAMessageLovInputBean vJobTitleBean =
(OAMessageLovInputBean)webBean.findChildRecursive("FndJobTitle");
OAMessageChoiceBean vVacancyTypeBean =
(OAMessageChoiceBean)dffBean.findChildRecursive("FndFlexField1");
OAMessageLovInputBean vOrgBean =
(OAMessageLovInputBean)webBean.findChildRecursive("FndOrganization");

vVacancyTypeBean.setSelectedValue(vVacancyType);
vGradeBean.setText( vGrade);
vJobTitleBean.setText(vJobTitle);
vOrgBean.setText(vOrganization);
// vOrgBean.set
OAMessageCheckBoxBean vEmpChkBox;
OAMessageCheckBoxBean vCntrChkBox;
vEmpChkBox =
(OAMessageCheckBoxBean)webBean.findChildRecursive("FndEmployee");
vCntrChkBox =
(OAMessageCheckBoxBean)webBean.findChildRecursive("FndContractor");

if (vVacancyType.equals("PMR") ) {
vEmpChkBox.setChecked(true);
vCntrChkBox.setChecked(false);
}else if(vVacancyType.equals("TMR") ) {
vCntrChkBox.setChecked(true);
vEmpChkBox.setChecked(false);
}
//Remove the view object, as this is no longer required
vacancyInfoVO.remove();
}
}

}



No comments:

Post a Comment