4 Replies Latest reply on Aug 7, 2013 9:42 AM by SLukyanov

    Issue with programmatically created LOV on Advanced Search Screen in OCO.

    User392737

      Hi All,

       

      I am trying to create a LOV programmatically on Advanced search screen of Oracle Customer's Online module for the country field present there, i have extended a controller and

      in it i am carrying out the creation for this.

       

      i am using the below code to do this.

       

      i am able to access the particular rowlayout bean and code below is starting after that.

       

      OARowLayoutBean CountryRowLayoutBean =
                              (OARowLayoutBean)RgtColTableLayoutBean.getIndexedChild(8);

                          if (pageContext.isLoggingEnabled(PROCEDURE))
                              pageContext.writeDiagnostics(this,
                                                           "CountryRowLayoutBean: " +
                                                           CountryRowLayoutBean,
                                                           PROCEDURE);
                          int CountryRowLytChldCount =
                              CountryRowLayoutBean.getIndexedChildCount();

                          if (pageContext.isLoggingEnabled(PROCEDURE))
                              pageContext.writeDiagnostics(this,
                                                           "CountryRowLytChldCount : " +
                                                           CountryRowLytChldCount,
                                                           PROCEDURE);
                          OAMessageTextInputBean CountryMsgTxt =
                              (OAMessageTextInputBean)CountryRowLayoutBean.getIndexedChild(2);

                          if (pageContext.isLoggingEnabled(PROCEDURE))
                              pageContext.writeDiagnostics(this,
                                                           "CountryMsgTxt : " +
                                                           CountryMsgTxt,
                                                           PROCEDURE);
                          CountryMsgTxt.setRendered(false);

                          OAMessageLovInputBean CountryLOV =
                              (OAMessageLovInputBean)createWebBean(pageContext,
                                                                   LOV_TEXT, null,
                                                                   MatchRuleAttrId); //MatchRuleAttrId - the fields are rendered through DQM so, this is the Id for the text input , same is taken as id for LOV, to enable search later.

                          if (pageContext.isLoggingEnabled(PROCEDURE))
                              pageContext.writeDiagnostics(this,
                                                           "CountryLOV : " + CountryLOV,
                                                           PROCEDURE);
                          CountryRowLayoutBean.addIndexedChild(CountryLOV);


                          Integer webBeanRegionAppId =
                              (Integer)webBean.getAttributeValue(REGION_APPLICATION_ID);

                          CountryLOV.setAttributeValue(REGION_APPLICATION_ID,
                                                          webBeanRegionAppId);
                          // Specify the path to the base page.
                          CountryLOV.setAttributeValue(REGION_CODE,
                                                          "/oracle/apps/imc/ocong/search/webui/ImcSearchPage");

                                    CountryLOV.setAttributeValue(LOV_REGION_APPLICATION_ID,
                                                          webBeanRegionAppId);

       

                          // Specify the LOV region definition.
                          CountryLOV.setLovRegion("/oracle/apps/ar/hz/address/webui/HzCountryLOV",
                                                     webBeanRegionAppId.intValue()); //Standard LOV region used

                          // Validation should be enabled for LOVs unless it's essential for the field to allow a partial value (in a "Search" region, for example).
                          CountryLOV.setUnvalidated(false);
                          CountryLOV.setAttributeValue(SELECTIVE_SEARCH_CRITERIA,
                                                          true);

                          CountryLOV.setAttributeValue(SEARCH, true);


                          // Configure the LOV mappings.
                          // Note that you must call this method after you add the messageLovInput item
                          // to the web bean hierarchy.
                          // base page item
                          // lov item
                          // direction

                          if (pageContext.isLoggingEnabled(PROCEDURE))
                              pageContext.writeDiagnostics(this,
                                                           "webBeanRegionAppId : " +
                                                           webBeanRegionAppId,
                                                           PROCEDURE);

                          if (pageContext.isLoggingEnabled(PROCEDURE))
                              pageContext.writeDiagnostics(this,
                                                           "MatchRuleAttrId : " +
                                                           MatchRuleAttrId,
                                                           PROCEDURE);


                          CountryLOV.addLovRelations(pageContext,
                                                        MatchRuleAttrId,
                                                        "TerritoryShortName",
                                                        LOV_RESULT,
                                                        LOV_REQUIRED_NO); // base page item
                          // lov item
                          // direction
                          CountryLOV.addLovRelations(pageContext,
                                                        MatchRuleAttrId,
                                                        "TerritoryShortName",
                                                        LOV_CRITERIA,
                                                        LOV_REQUIRED_NO);

       

       

      I am facing the issue that the torch icon is visble on the screen but when i click on it, it does not display the LOV region and a blank page saying website declined to show the page is displayed.

       

      Please suggest what needs to be added that i am missing right now.

       

      Thanks,

      Mayank