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

    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

       

       


        • 1. Re: Issue with programmatically created LOV on Advanced Search Screen in OCO.
          User392737

          HI ALL,

           

          Can someone please provide your inputs  for this, it is still not resolved.

           

          Thanks,

          Mayank

          • 2. Re: Issue with programmatically created LOV on Advanced Search Screen in OCO.
            SLukyanov

            1) First of all I would advise to use declarative defenition of LOV. i mean you can add a region item programaticaly and this region can use a static Externl LOV.

              Actulay I had experience with programaticlay created LOVs and finaly refused to use this as sometime it was working not good.

             

            2) if you still want to create LOV programaticaly probaly you can try

              move this statement

            CountryRowLayoutBean.addIndexedChild(CountryLOV);

            after this statement

            CountryLOV.setAttributeValue(SEARCH, true);

            • 3. Re: Issue with programmatically created LOV on Advanced Search Screen in OCO.
              User392737

              Thanks for your inputs.

               

              The region in the page i am working on does not allow for addition of new item and adding lov through personalization is not possible,

              due to which we have taken this approach.

               

              I tried the second option as you mentioned but still getting the same issue.

               

              It still shows the torch icon but the same blank page is displayed when clicked.

               

              Please share the code that you used for succesful implementation of LOV programmatically.

               

              Thanks,

              Mayank

              • 4. Re: Issue with programmatically created LOV on Advanced Search Screen in OCO.
                SLukyanov

                on the first option I mean you can add new region  programaticaly like this on Processrequest

                 

                            OAStackLayoutBean newLocationLovs=

                                (OAStackLayoutBean)createWebBean(pageContext

                                                                    ,"/yandex/oracle/apps/csi/instance/location/webui/YaLocationLovsRN"

                                                                    , "xxnewLocationLovs"

                                                                    ,true);

                             

                              webBean.addIndexedChild(newLocationLovs);