5 Replies Latest reply: Jun 25, 2013 6:06 AM by Sandeep M. RSS

    set defalut value for message choice filed in seeded page

    990193

      Hi Team,

       

       

      I have requirement , in seeded page three message choice fields are there. we need to set some default values and make them as read only.

       

      But that region we three fields are available is created in controller and message choice fields are also created in controller so those filed are not having any VO are VO attribute.

       

      I extend the controller for that region and did following coding.

      OAMessageChoiceBean oamessagechoicebean=(OAMessageChoiceBean)webBean.findChildRecursive("NRR0");

                    if(oamessagechoicebean!=null)

                    {

                      oamessagechoicebean.setSelectionValue(pageContext,"PRORATE");

                      oamessagechoicebean.setDisabled(true);   

                    }

      OAMessageChoiceBean oamessagechoicebean1=(OAMessageChoiceBean)webBean.findIndexedChildRecursive("NRR1");

                    if(oamessagechoicebean1!=null)

                    {

                      oamessagechoicebean1.setSelectionValue(pageContext,"LIFO");

                      oamessagechoicebean1.setDisabled(true);

                    }

      OAMessageChoiceBean oamessagechoicebean2=(OAMessageChoiceBean)webBean.findIndexedChildRecursive("NRR3");

                    if(oamessagechoicebean2!=null)

                    {

                      oamessagechoicebean2.setSelectionValue(pageContext,"LIMITS");

                      oamessagechoicebean2.setDisabled(true);

                    }

                   

      when i click on submit button following showing

         values of  "Field name"  cannot be null or blank,select valid value(these fields are mandatory fileds )

      please help on this issue thanks in advance.

      Rajashekar

        • 1. Re: set defalut value for message choice filed in seeded page
          Sandeep M.

          Hi,

           

          Whats the OA version?

           

          Which page controller you are extending?

           

          How did you confirm that these beans are created in standard controller and could you post that code here?

           

          Before you click on submit do you see the default value you had set?

           

          Please let us know any information that can help to understand.

           

          Regards,

          Sandeep M.

          • 2. Re: set defalut value for message choice filed in seeded page
            990193

            Hi sandeep,

             

            OA version is 12.1.3

            controller which attach to message choice fields region.

            Controller code which creating message choices

                            if("LOOKUP".equalsIgnoreCase(s10))
                            {
                                OAViewObject oaviewobject4 = (OAViewObject)(OAViewObject)oaapplicationmodule.findViewObject((new StringBuilder()).append("LookupCodesVO").append(i1).toString());
                                if(oaviewobject4 == null)
                                    oaviewobject4 = (OAViewObject)oaapplicationmodule.createViewObject((new StringBuilder()).append("LookupCodesVO").append(i1).toString(), "oracle.apps.fnd.wf.worklist.server.LookupCodesVO");
                                Serializable aserializable4[] = {
                                    s11
                                };
                                if(flag2)
                                    oaviewobject4.invokeMethod("initQueryDigSig", aserializable4);
                                else
                                    oaviewobject4.invokeMethod("initQuery", aserializable4);
                                oaviewobject4.reset();
                                OAMessageChoiceBean oamessagechoicebean = (OAMessageChoiceBean)createWebBean(oapagecontext, "MESSAGE_POPLIST");
                                oamessagechoicebean.setUINodeName((new StringBuilder()).append("NRR").append(i1).toString());
                                oamessagechoicebean.setListDisplayAttribute("Meaning");
                                oamessagechoicebean.setListValueAttribute("LookupCode");
                                oamessagechoicebean.setListViewObject(oapagecontext, oaviewobject4);
                                oamessagechoicebean.setPickListCacheEnabled(false);
                                String s21 = (String)oarow3.getAttribute("TextValue");
                                oamessagechoicebean.setSelectionValue(oapagecontext, s21);
                                oamessagechoicebean.setVAlign("middle");
                                oamessagechoicebean.setPrompt(s13);
                                oamessagechoicebean.setShortDesc(s14);
                                oamessagecomponentlayoutbean.addIndexedChild(oamessagechoicebean);
                                continue;
                           

            }

            in previous post i have set default values code.

            can u please help on this.

            • 3. Re: set defalut value for message choice filed in seeded page
              Sandeep M.

              Hi,

               

              These beans are created dynamically so you cannot get them using findChildRecursive.

               

              Try using:

               

              UINode colNode = oamessagecomponentlayoutbean.getIndexedChild(pageContext.getRenderingContext(), j);

               

              then convert colNode to OAMessageChoiceBean and then apply custom logic.

               

              You can check the colNode class also using:

              colNode.getClass().getSimpleName().equals("OAMessageChoiceBean")

               

              Also make sure call to super.processRequest is before your code.

               

              Regards,

              Sandeep M.

              • 4. Re: set defalut value for message choice filed in seeded page
                990193

                HI Sandeep,

                 

                In seeded page Messagecomponentlayout region also created dynamically. This region also dont have ID to get OAMessagelayoutbean.

                 

                  

                Thanks

                Rajashekar.

                • 5. Re: set defalut value for message choice filed in seeded page
                  Sandeep M.

                  For region also you can follow above code and then once you get region UINode object then you can call getIndexedChild on that object.

                   

                  Regards,

                  Sandeep M.