3 Replies Latest reply: Feb 4, 2013 8:19 PM by scott.wesley RSS

    tabular form condition type value of item / column in expression 1

    derekf
      Hi

      Question 1
      I was wondering if anyone can help with the necessary syntax so that I can set a Condition Type for a column in a Tabular Form.

      What I'm trying to do is show or hide a column based on the contents of another column in the same row for instance show column DETAIL or DETAIL_READ_ONLY if column READ_ONLY is set to 'Y'
      Value of item / column in expression 1 = #READ_ONLY# or READ_ONLY (alas neither works)
      Expression 2 = Y


      I can set all the DETAIL or DETAIL_READ_ONLY columns to either hide or show at the same time by


      Value of item / column in expression 1 = P100_READ_ONLY (works well but lacks granularity)
      Expression 2 = Y

      Question 2
      Are Tabular Forms such that all fuctionality has to be global, what effects one column must be the same for all

      I know that Oracle prefers that developers don't use tabular forms but they are usefull for data visability when setting up related data in the same table.
      e.g. surveys, questionnaires etc apps the web was made for

      Thanks
      Derek
        • 1. Re: tabular form condition type value of item / column in expression 1
          928468
          Hi Derek,

          which Apex version are you on?

          I'm not sure if I exactly understand what you want to achieve.

          Do you want to hide the "field" in column DETAIL_READ_ONLY (meaning the column for a certain row) or just the "value" if READ_ONLY is = 'N'?

          Basically, the column DETAIL_READ_ONLY can either be shown or not for all rows, depending on the condition defined.

          If you want to hide the value of DETAIL_READ_ONLY for certain rows only, but show the column if at least one row has READ_ONLY = 'Y', you would need to specify the condition directly in the query of the form/item.
          Something like
          select DETAIL_READ_ONLY from YOURTABLE where READ_ONLY = 'Y' /*and your other conditions*/) 
          This also works as Inline-Select.

          Is this what you are looking for?

          Thanks
          Sandro
          • 2. Re: tabular form condition type value of item / column in expression 1
            derekf
            Hi Sandro

            Thanks for replying

            The problem I have is Tabular Forms

            Detail Text Detail Read Only Read only
            ------------- ---------------------- --------------
            Event 1a Event 1b Y
            Event 2a Event 2b N
            Event 3a Event 3b Y

            What I want it to look like is

            Detail Text Detail Read Only Read only
            -------------
            ___________Event 1b__________ Y
            Event 2a_____________________ N
            ___________Event 3b__________ Y

            This would mean that the Text Field containing Event 2 could be updated but the Display Only fields containing Event 1 and Event 3 cannot be changed.
            The trick is to be able to mix and match data types for the same data because Tabular Forms columns don't have a conditional read only choice.

            Sorry about the rudimentary diagram, but its the old 80 / 20 rule =>20 percent functional

            Edited by: derekf on 4/02/2013 17:50
            • 3. Re: tabular form condition type value of item / column in expression 1
              scott.wesley
              I know that Oracle prefers that developers don't use tabular forms
              Some people who happen to be Oracle employees have that opinion, but it's more a necessary evil sometimes.

              You only hide an entire column on a report, or not. You might be referring to individual cells.
              With diagrams, try adding { code } for fixed width.

              Sounds like an SQL problem
              SELECT CASE WHEN read_only = 'Y' THEN detail END detail_text
                    ,CASE WHEN read_only = 'N' THEN detail END detail_read_only
                    ,read_only
              FROM your_table
              Scott
              blog: [url grassroots-oracle.com]grassroots-oracle.com
              twitter: [url twitter.com/swesley_perth]@swesley_perth

              -- please mark any useful posts as helpful or correct, in the end it helps us all