Thursday, January 31, 2019

Oracle OAF :- Default KFF Value



/*  34 */     OAKeyFlexBean kffId = (OAKeyFlexBean)webBean.findIndexedChildRecursive("WriteoffCodeCombination");
/*     */
/*  36 */     kffId.useCodeCombinationLOV(true);
/*  37 */     kffId.setStructureCode(str12);
/*  38 */     kffId.setCCIDAttributeName("WriteoffCodeCombinationId");
/*  39 */     kffId.setRequired("yes");
/*  40 */     kffId.setWidth("170%");
/*  41 */     kffId.addVRule("", "SUMMARY_FLAG", new Message("SQLGL", "GL_NO_PARENT_SEGMENT_ALLOWED"), true, new String[] { "N" });
/*     */   
             /* Todays Changes */
              kffId.processFlex(pageContext);
              int i = kffId.getIndexedChildCount(pageContext.getRenderingContext());
        for (int j = 0; j < i; j++) {
oracle.cabo.ui.UINode uinode =  kffId.getIndexedChild(pageContext.getRenderingContext(), j);
        if ("WriteoffCodeCombination_COMBINATION".equalsIgnoreCase(uinode.getID())) ((OAMessageLovTextInputBean)uinode).setText("541.000.00.00.00.111101.0000.000.0000.0000");
             }

Wednesday, January 9, 2019

Oracle OAF :- Search Button Logic

Controller
===========================================

  if (pageContext.getParameter("Search") != null)  {
   String BuildingID = pageContext.getParameter("SearchBuild");
   String FloorID = pageContext.getParameter("SearchFloor");
   String OfficeID = pageContext.getParameter("SearchOffice");
   am.xxinitBuildQuery(BuildingID, FloorID, OfficeID);
  }


Application Module
============================================


public void xxinitBuildQuery(String BuildingID, String FloorID, String OfficeID) {
     BuildingVOImpl vo = getBuildingVO1();
     vo.xxBuildingDetails(BuildingID, FloorID, OfficeID);

    if (((BuildingID == null) || ("".equals(BuildingID))) && ((FloorID == null) || ("".equals(FloorID))) && ((OfficeID == null) || ("".equals(OfficeID))))
       throw new OAException("If Building ,Floor & Office search options are null, then this page will display all the location data", (byte)2);
   }


View Object
============================================

 public void xxBuildingDetails(String BuildingID, String FloorID, String OfficeID)
   {
     if ((BuildingID != null) && (!"".equals(BuildingID)))
     {
      setWhereClauseParam(0, BuildingID);
     }
     else setWhereClauseParam(0, null);

     if ((FloorID != null) && (!"".equals(FloorID)))
    {
       setWhereClauseParam(1, FloorID);
     }
    else setWhereClauseParam(1, null);

    if ((OfficeID != null) && (!"".equals(OfficeID)))
     {
       setWhereClauseParam(2, OfficeID);
     }
     else setWhereClauseParam(2, null);

    executeQuery();
  }

View Query
========================

SELECT *
  FROM  pn_locations_v
 WHERE  location_code = NVL (:1, location_code)
      AND (NVL (:2, 'A') = 'A'
            OR (location_id =
                   (SELECT flr.parent_location_id
                      FROM pn_locations_all flr
                     WHERE     flr.location_code = :2
                           AND flr.location_type_lookup_code = 'FLOOR'
                           AND ROWNUM = 1)) )
         AND  (NVL (:3, 'A') = 'A'
            OR   (location_id =
                   (SELECT flr.parent_location_id
                      FROM pn_locations_all flr
                     WHERE     flr.location_id = (SELECT flr.parent_location_id
                      FROM pn_locations_all flr
                     WHERE     flr.location_code = :3
                           AND flr.location_type_lookup_code = 'OFFICE' AND ROWNUM = 1)
                           AND flr.location_type_lookup_code = 'FLOOR'
                           AND ROWNUM = 1)) )

Sunday, January 6, 2019

Oracle OAF :- Lov Dynamic Parameter



AM
====================================================

public void initPOLovVO(String orgIDStr)
{
   itemLovVOImpl vo = getItemLovVO1();
   vo.clearCache();
   vo.setWhereClause(null);
   vo.setWhereClause("org_id = "  + orgIDStr);
   vo.executeQuery();
}



Process Request
===================================

LovPageAMImpl am = (LovPageAMImpl)pageContext.getApplicationModule(webBean);
am.initPOLovVO ("-1");



Process Form Request
==============================

if (pageContext.isLovEvent())
  {
  String lovSourceIDStr = pageContext.getLovInputSourceId(); /* Get the ID of the Lov Item */  
  if (lovSourceIDStr != null && "orgNameLovID".equals(lovSourceIDStr)) /* Compire it with the required lov ID */
  {
  OAMessageLovInputBean orgNameLovIDBean = (OAMessageLovInputBean)webBean.findIndexedChildRecursive("orgNameLovID");
  String orgNameStr = (String)orgNameLovIDBean.getValue(pageContext); /* Get the Lov Item Data*/
  OAFormValueBean orgIDFVBean = (OAFormValueBean)webBean.findIndexedChildRecursive("tempOrgId");
          String orgID = (String)orgIDFVBean.getValue(pageContext); /* Get the Form Value Data*/
          am.initPOLovVO (orgID);
  } 
  }