28 November, 2017

OAF :Formatting DateTime Fields

Use the following code to format DateTime feilds in OAF

OAWebBean departureDateBean = webBean.findChildRecursive("DepartureDate");

OANLSServices nls = pageContext.getOANLSServices();
oracle.cabo.ui.validate.Formatter formatter =
    new OADateValidater(nls.getUserJavaDateFormat() + " HH:mm",
                        nls.getUserRRRRJavaDateFormat() + " HH:mm");
                       
departureDateBean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);


Thanks

26 November, 2017

OAF : Bundled Exceptions

Bundled exceptions let you accumulate "peer" exceptions while proceeding with validation, and then display them as a set when you are done. These peer exceptions are grouped in a container exception called a bundled exception.

To creat a bundled exception, you first must create a list to which you add exceptions as you encounter them:

ArryList peerExceptions = new ArrayList();
peerExceptions.add(new OAException(....));
peerExceptions.add(new OAException(....));

//Raise Exceptions
OAException.raiseBundledOAException(peerExceptions );

Thanks

21 November, 2017

OAF : Programmatically Add a Parameterized Pop-up

To programmatically add a parameterized pop-up to a component , add the following code in processRequest method

Step 1: Create an OAPopupBean 

 OAPopupBean popupBean1=(OAPopupBean)createWebBean(pageContext,POPUP_BEAN,null,"myPopup1");
popupBean1.setID("myPopup1");
popupBean1.setUINodeName("myPopup1");
popupBean1.setRegion("/oracle/apps/per/xyz/webui/PopupRN");
popupBean1.setHeight("130");
popupBean1.setWidth("320");
popupBean1.setTitle("Popup Title");
popupBean1.setParameters("personId={@PersonId}");
popupBean1.setType(PARAMETERIZED_POPUP);


Step 1: Add popup to item which you want to enable the pop-up, for example "EmpDtlBtn" button

OAButtonBean empDtlBtnBean = (OAButtonBean)webBean.findChildRecursive("EmpDtlBtn");
empDtlBtnBean.setPopupEnabled(true);
empDtlBtnBean.setPopupRenderEvent("onClick");
empDtlBtnBean.setPopupID("myPopup1");

webBean.addIndexedChild(popupBean1);


Thanks

OAF :Formatting DateTime Fields

Use the following code to format DateTime feilds in OAF OAWebBean departureDateBean = webBean.findChildRecursive("DepartureDate"...