8 Replies Latest reply: Nov 14, 2012 6:51 PM by Gyan Darpan RSS

    Set Null values in MessageLOV

    divya.kantem
      Hi,

      I have DFF's in a page, which are LOV's. I need to set the DFF's to null based on certain criteria.

      I am using the below code, but it is not defaulting.

      OADescriptiveFlexBean dffBean = (OADescriptiveFlexBean)oawebbean.findIndexedChildRecursive("ReqLineDescFlex");
      dffBean.processFlex(oapagecontext);

      OAMessageLovInputBean Segment1 = (OAMessageLovInputBean)dffBean.findChildRecursive("ReqLineDescFlex0");
      OAMessageLovInputBean Segment2 = (OAMessageLovInputBean)dffBean.findChildRecursive("ReqLineDescFlex1");
      OAMessageLovInputBean Segment3 = (OAMessageLovInputBean)dffBean.findChildRecursive("ReqLineDescFlex2");
      Segment1.setValue(oapagecontext,"");
      Segment2.setValue(oapagecontext,"");
      Segment3.setValue(oapagecontext,"");

      Appreciate your help.

      Thanks,
      Divya
        • 1. Re: Set Null values in MessageLOV
          keerthioaf
          Hi Divya ,

          Where have you written this code , process Request () / ProcessFormRequest () ??

          Keerthi
          • 2. Re: Set Null values in MessageLOV
            divya.kantem
            I have this code in a function, which internally is forwarding to the same page.
            • 3. Re: Set Null values in MessageLOV
              keerthioaf
              Divya ,

              When the value set is attached to DFF it becomes Message Lov Input , please see what is the item style of the DFF , If its
              and LOV input then please try with the below code .


              OAMessageLovInputBean TicketEligibleDff=(OAMessageLovInputBean)oawebbean.findIndexedChildRecursive("OfferDetailsFlex18");
              if(TicketEligibleDff!= null)
              {

              oapagecontext.writeDiagnostics(this, "DFF Bean not null ",OAFwkConstants.STATEMENT); // ensure that bean is not null

              String dffNull = "" ;
              TicketEligibleDff.setText(dffNull );
              }


              or

              OAMessageLovInputBean TicketEligibleDff=(OAMessageLovInputBean)oawebbean.findChildRecursive("OfferDetailsFlex18");
              if(TicketEligibleDff!= null)
              {

              oapagecontext.writeDiagnostics(this, "DFF Bean not null ",OAFwkConstants.STATEMENT); // ensure that bean is not null

              String dffNull = "" ;
              TicketEligibleDff.setText(dffNull );
              }

              Note : Please check whether the bean is not null then only you can set the value and try with both methods (findChildRecursive/findIndexedChildRecursive) .

              Keerthi
              • 4. Re: Set Null values in MessageLOV
                884536
                Hi,

                make sure that the bean ID of the Lov's are correct. i suggest you to check the ID's using view source.

                gk
                • 5. Re: Set Null values in MessageLOV
                  divya.kantem
                  Thanks Keerthi.. It is setting the LOV to null.
                  In case I have selected the value in LOV1, then changed the value in LOV2 to 'Y', then LOV1 should change to null.
                  This is working fine, but when I change the LOV2 to 'N', LOV1 is populating the previous value. I hope the null value is for display only, not updated in the backend.

                  any idea how to fix this.

                  Thanks,
                  Divya
                  • 6. Re: Set Null values in MessageLOV
                    Gyan Darpan
                    Hi,

                    "This is working fine, but when I change the LOV2 to 'N', LOV1 is populating the previous value. I hope the null value is for display only, not updated in the backend."

                    As per my understanding, you have Lov1 and Lov2 where Lov2 is dependent upon Lov1. If you want to set any value to Lov1 on the selection of Lov2 then you need to customize your controller and set it programmatically.

                    Regards,
                    Gyan
                    • 7. Re: Set Null values in MessageLOV
                      divya.kantem
                      Hi Gyan.. LOV1 is not always dependent on LOV2.
                      If LOV2 is 'Y', then LOV1 should default to Null.
                      If LOV2 is 'N' or null, then LOV1 should not be defaulted.

                      My question is how to set the LOV to default to Null, setText is just setting it at the display, but not actually setting the LOV result to Null.
                      using setValue is also not working as expected
                      • 8. Re: Set Null values in MessageLOV
                        Gyan Darpan
                        Divya,

                        So it's setting the value to null on top of the page, but when you try to save the value it do saves the previos or last value into to the database.

                        Setting up the text to null, always set the backend value also to null.

                        There should be some page refresh related issue. Can you forward me your controller code and the page naviagtion path on which you are doing the customization.

                        Regards,
                        Gyan