1 Reply Latest reply: Jan 11, 2013 9:13 AM by riedelme RSS

    Select list enable / disable in tabular form

    Vedant
      Hi,

      I have created report on (ACT_COA_SEGMENT_MAS) table and this is master table , and created link on this report, when i click on report link, control moves to tabular form that is based on detail table (ACT_SEGMENT_VALUES_MAS)

      In master table there is column,

      SEGMENT_ID number primary key;
      QUALIFIER varchar2(1);


      If in master table qualifier column value is 'N' then

      then in detail table (ACT_SEGMENT_VALUES_MAS) column account type cannot be null and column should enable.
      If in master table QUALIFIER column value other than 'N' then Account column in detail table should disable . and value should not be enterable.
      and ACCOUNT_TYPE column in deatil table is a select list.

      How i can do this?

      Thanks & Regards
      Vedant

      Edited by: Vedant on Jan 10, 2013 10:14 PM
        • 1. Re: Select list enable / disable in tabular form
          riedelme
          Vedant wrote:
          If in master table qualifier column value is 'N' then

          then in detail table (ACT_SEGMENT_VALUES_MAS) column account type cannot be null and column should enable.
          If in master table QUALIFIER column value other than 'N' then Account column in detail table should disable . and value should not be enterable.
          and ACCOUNT_TYPE column in deatil table is a select list.

          How i can do this?
          One way - sadly a bit of work - would be to use APEX_APPLICATION_ITEM to generated the detail items as a manual tablular form where you can control the disabled property when generating the tabular form fields using CASE statements, writing manual PL/SQL processes and the built-in APEX_ITEM collection to manually perform insert/update/delete operations on submit. Check the documentation for the full syntax of using APEX_ITEM functions to generate HTML items.

          An example from the Oracle docs looks like
          SELECT 
            empno, 
            APEX_ITEM.HIDDEN(1,empno)||
            APEX_ITEM.TEXT(2,ename) ename, 
            APEX_ITEM.TEXT(3,job) job, 
            mgr, 
            APEX_ITEM.DATE_POPUP(4,rownum,hiredate,'dd-mon-yyyy') hiredate,
            APEX_ITEM.TEXT(5,sal) sal, 
            APEX_ITEM.TEXT(6,comm) comm,
            deptno
          FROM emp
          ORDER BY 1
          where the disabled property could be specified in the unlisted fifth argument to APEX_ITEM.TEXT. The first item to the APEX_ITEM calls is a number defining the G_FXX global variables so that 1 identifies the item later as apex_application.g_f01(9) - 9 being symbolic for a collection identifier -, ename as apex_application.g_f02(i),m and so on. The G_F99 items can be reference on submission in Pl/SQL processes through looping, something like (this example assumes all array items are populated - under some circumstances they may not be)
          for i in 1..apex_application.g_f01.count loop
            update my_table set sal = apex_application.g_f05(i) where empno = apex_application.g_f01(i);
          end loop;
          Edited by: riedelme on Jan 11, 2013 7:12 AM