3 Replies Latest reply: Feb 5, 2013 3:05 AM by Gus C RSS

    APEX_ITEM.DATE_POPUP2 and Nulls

    Gus C
      In my updateable report I have a column, which is a date.
      APEX_ITEM.DATE_POPUP2(6,p.value_date,'DD.MM.YYYY','15','10','style=""',null,null,null,null,null,'both',null,'MONTH_AND_YEAR')  value_date_new
      I need to change this field to null and disable if a certain condition is met.
      case when p.parameter = 'TRANSFERDAY' then null
                  else
      APEX_ITEM.DATE_POPUP2(6,p.value_date,'DD.MM.YYYY','15','10','style=""',null,null,null,null,null,'both',null,'MONTH_AND_YEAR')  end value_date_new
      I have searched for APEX_ITEM.DATE_POPUP2 but cannot find an answer to my problem

      Cheers

      Gus
        • 1. Re: APEX_ITEM.DATE_POPUP2 and Nulls
          Joni Vandenberghe
          You already answered alot of your own question I think
          case when p.parameter = 'TRANSFERDAY' then 
          APEX_ITEM.DATE_POPUP2(6,NULL,'DD.MM.YYYY','15','10','style="" disabled="disabled"',null,null,null,null,null,'both',null,'MONTH_AND_YEAR')
                      else
          APEX_ITEM.DATE_POPUP2(6,p.value_date,'DD.MM.YYYY','15','10','style=""',null,null,null,null,null,'both',null,'MONTH_AND_YEAR')  end value_date_new
          I added null and disabled.

          Btw it helps alot for readability if you use named parameters
          • 2. Re: APEX_ITEM.DATE_POPUP2 and Nulls
            Joni Vandenberghe
            You already answered alot of your own question I think
            case when p.parameter = 'TRANSFERDAY' then 
            APEX_ITEM.DATE_POPUP2(6,NULL,'DD.MM.YYYY','15','10','style="" disabled="disabled"',null,null,null,null,null,'both',null,'MONTH_AND_YEAR')
                        else
            APEX_ITEM.DATE_POPUP2(6,p.value_date,'DD.MM.YYYY','15','10','style=""',null,null,null,null,null,'both',null,'MONTH_AND_YEAR')  end value_date_new
            I added null and disabled.

            Btw it helps alot for readability if you use named parameters
            • 3. Re: APEX_ITEM.DATE_POPUP2 and Nulls
              Gus C
              Have changed my code to
              ,case when parameter = 'TRANSFERDAY' then 
              APEX_ITEM.DATE_POPUP2(6,NULL,'DD.MM.YYYY','15','10','style="" disabled="disabled"',null,null,null,null,null,'both',null,'MONTH_AND_YEAR')
              else
              APEX_ITEM.DATE_POPUP2(6,value_date,'DD.MM.YYYY','15','10','style=""',null,null,null,null,null,'both',null,'MONTH_AND_YEAR')  end value_date_new
              On the report the field is greyed out and no data is displayed, which is correct.
              Now when I save the data, it is using the value of value_data from the next row

              Gus