4 Replies Latest reply on Dec 8, 2018 1:14 PM by Bozzy-Oracle

    Link Color in an Interactive Grid

    Bozzy-Oracle

      Hi.

       

      I am using APEX 5.1. My question is two-fold.

       

      First I want to include 2 PL/SQL database stored function calls as a pseudo column in my GI query.

       

      The SQL is something like:

       

      SELECT ...

                   acs_ohp.host_kernel_check_fails ( host_guid                                                      -- <= Yet to be added.to my SQL

                                                                      ,  :P114_TEMPLATE_ID) AS check_fail_count,  -- <= Yet to be added.to my SQL

                   DECODE(acs_ohp.host_kernel_check_fails ( host_guid

                                                                                      ,  :P114_TEMPLATE_ID), 0, app_utl.get_style('STS_PASS'), app_utl.get_style('STS_FAIL')) as link_style,

                    HOST_GUID   as view_link

      FROM ...

       

       

      I included the second expression / function already, setting...

       

      Source Type to Database Column

      Data Type to VARCHAR2

      Query Only : Yes

      Primary Key No.

       

      Having done this I find that the column does not appear when I run the page (and is not showing in Action -> Columns.

      The second expression returns some styling CSS, based on a  which I want to apply to a link column, using #LINK_STYLE#. I wish to change the colour of the link icon, based on the function return.

      The first expression (not yet implemented) includes the same function, which returns a count that I wish to display.

       

      So, is there a problem with my approach here?

       

      Thanks,

       

      Clive

        • 1. Re: Link Color in an Interactive Grid
          Bozzy-Oracle

          I made some progress on this, but I had to create a brand new interactive grid to get the function based column to show. In my previous IG the function based expression was added later. The issue now is that the styling, which my expression returns (column alias  link_style), isn't being applied to the link.I am using Link Text:

           

          <span class="fa  fa-sliders" style="#LINK_STYLE#"></span>

           

          For example, if my function returns 0 the expression from link_style returns: color: #00A63D ; font-size: 170%

           

          Does this approach work with Interactive Grids in a similar way as it does for reports?

          • 2. Re: Link Color in an Interactive Grid
            Franck N

            Sorry,

             

            but i can not understand what you are aiming for here and what is not working.

            Please reproduce  your use on apex.oracle.com  with your implementation.

             

            and explain again what is not working and what is the expected output.

             

            regards,

            Franck

            • 3. Re: Link Color in an Interactive Grid
              Bozzy-Oracle

              Franck,

               

              I had two challenges. As per my last post I have reduced this to one challenge. Which is dynamically applying a colour to a link icon in my Interactive Grid. The technique is similar to the one outlined here by Tyler Muth: https://tylermuth.wordpress.com/2007/12/01/conditional-column-formatting-in-apex/

               

              The difference here though is that I am using an IG instead of a report region and I also decide on the CSS styling output based on a function call to the database. I already use my technique, in for example, Interactive Reports and it works fine for those.

               

              In Tyler's link, he is simply returning a colour literal and embedding that in the CSS styling for the column. I am using a similar technique except that I am having my query generate more of the style components (using my function call / decode) than in Tyler's example. My DECODE / Function expression returns one of two possible values:

               

              1. color: #00A63D ; font-size: 170%
              2. color: #FF0000 ; font-size: 170%

               

              The column alias, for the above possible values in my query is LINK_STYLE.

               

              So I was hoping that I would be able to use something like:

               

              <span class="fa  fa-sliders" style="#LINK_STYLE#"></span>

               

              As my Link column text:

               

               

              Thanks,

               

              Clive

              • 4. Re: Link Color in an Interactive Grid
                Bozzy-Oracle

                I just found a discussion in which John Snyder explains that this approach does not work with Interactive Grids.