3 Replies Latest reply on Mar 12, 2008 3:35 PM by (Sean_DeMerchant)

    dymanic list that shows only non-empty columns?

      Hi all,

      I have a large table that I would like to show as dynamic list.

      But it is too large and it is difficult to use this way.

      Lots of columns are empty (because not all products use all the
      database columns), so my questoin is:

      is there a way to show only the NON-EMPTY columns in a dynamic list?

      Thanks in advance for any suggestion.

      tony
        • 1. Re: dymanic list that shows only non-empty columns?
          Günter Schenk Level 4
          Hi Tony,

          you can exclude empty columns by adding the "IS NOT NULL" condition to the list´s query -- but as this query already has a WHERE clause plus an ORDER BY clause, you´ll need to insert this extra condition between these two by using the AND operator, example:

          SELECT * FROM table_name WHERE {$NXTFilter_rswhatever1} AND column_name1 IS NOT NULL ORDER BY {$NXTSort_rswhatever1}

          Works ?

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: dymanic list that shows only non-empty columns?
            Level 1
            >Hi Tony,
            >you can exclude empty columns by adding the "IS NOT NULL" condition to the list´s query -- but as this query already has a WHERE clause plus an ORDER BY clause, you´ll need to insert this extra condition between these two by using the AND operator, example:
            >SELECT * FROM table_name WHERE {$NXTFilter_rswhatever1} AND column_name1 IS NOT NULL ORDER BY {$NXTSort_rswhatever1}
            >Works ?

            Hi Günter,
            no, it doesn't work. :(.

            I think the problem is the SELECT *, since it will parse all table
            fields.

            It would be nice to have a condition on that * and specify to not
            select empty fields (columns).

            Thanks for your suggestion, anyway ;).

            tony
            • 3. Re: dymanic list that shows only non-empty columns?
              Without more complex programming and sticking with just using the ADDT you might be better off simply having multiple pages which each use a different database query.

              The issue here is that the dynamic list wizard statically creates the table layout for the result set. So differing result sets with different columns will require different auto-generated code.

              You could use a form containing a select box that sets a get parameter used at runtime in PHP to choose which dynamic list to display. But this requires hand coding.