This discussion is archived
9 Replies Latest reply: Jul 25, 2013 4:53 AM by Rennokas RSS

Html region header coloring

Rennokas Newbie
Currently Being Moderated

Hi,

 

How to color HTML region header depending on SQL query result ?

 

 

Renno

  • 1. Re: Html region header coloring
    Rennokas Newbie
    Currently Being Moderated

    by header I mean region Title.

  • 2. Re: Html region header coloring
    Nicolette Expert
    Currently Being Moderated

    Rennokas

     

    What do you mean with "SQL query result"?

    Do mean something like if more than X rows returned by the report then color the title of the report region red.

     

    Are you looking for a javascript solution or in pl/sql?

    There might be a straight forward dynamic action possible.

     

    Basically is find a way to determine what CSS class it should be.

    And set that class for the title of that region.

     

    For the pl/sql solution you would need a region template specific for this region.

    And you would need a apex (page) item to hold the name of the class for example PXX_CLASS.

    Now change the region template such that in the html that holds the title the PXX_CLASS is referenced

    Something like class="&PXX_CLASS." .

     

    For the javascript and dynamic action solution getting the selector right may be the hardest part for this we really need an example of what your are working with on apex.oracle.com.

     

    Without out any futher information of which an example on apex.oracle.com would be of the most help we cann't offer any more assistance.

     

    Nicolette

  • 3. Re: Html region header coloring
    fac586 Guru
    Currently Being Moderated

    Rennokas wrote:

     

    Hi,

     

    How to color HTML region header depending on SQL query result ?

    It depends. On a lot of information you have not provided.

     

    Always provide the following information when asking a question:

     

    • APEX version
    • Database version, edition and host OS
    • Web server type (OHS, EPG, or APEX Listener), version, configuration and host OS
    • Browser(s) and version(s) used

     

    When the question relates to visual formatting and layout like this one, we also need to know:

     

    • Theme
    • UI
    • Page, region, and component templates involved

     

    Reproducing the problem on apex.oracle.com so we can see it at first hand is always recommended. Asking the question as effectively as possible by following the guidelines here and here will also help in getting a rapid resolution.

     

    When and where is the SQL query to be evaulated?

     

    by header I mean region Title.

    And by "color" do you mean the title text or background color? Or both?

  • 4. Re: Html region header coloring
    Rennokas Newbie
    Currently Being Moderated

    Im looking for dynamic action which colors text for html region title. Yes, the coloring should depend on SQL query like you mentioned. Jscript would be ok.

    Im using Apex 4.0 on 11.2 XE.

  • 5. Re: Html region header coloring
    Rennokas Newbie
    Currently Being Moderated

    Im using jQuery Accordion So that I have 2 layers of accordions - Html0 opens up Html1 and Html2. Each of the subregions have 2 classic reports under them.

    Basically I need the Html1 and Html2 subregions to have colored titles.

  • 6. Re: Html region header coloring
    Nicolette Expert
    Currently Being Moderated

    Rennokas

     

    And just to show how easy it actually is to set up an example on apex.oracle.com

     

    As stated before the javascript and dynamic action solution totally depends on the theme and templates you are using.

    So unless you are willing to invested some time to set something up on apex.oracle.com we can't help you any further.

     

    Nicolette

  • 7. Re: Html region header coloring
    Rennokas Newbie
    Currently Being Moderated

    I got it to work, I added ID to <H3> element and used jquery selector in dynamic action. But Im wondering how do I get it to work in an 5 minute interval. Let say that the value of the title would be the input for SQL which determines whether to color it green or red.

    Is there an dynamic action which could be triggered every 5 minutes with condition of SQL result in it.

  • 8. Re: Html region header coloring
    Nicolette Expert
    Currently Being Moderated

    Rennokas

     

    There is a timer dynamic action plugin from oracle.

     

    Nicolette

  • 9. Re: Html region header coloring
    Rennokas Newbie
    Currently Being Moderated

    Thank you ! Timer dynamic action solved all the problems for me.

    What I did was:

     

    Added timer dynamic action for the page.

    Added timer expire dynamic action which refreshes/sets hidden page items (which have sql in them).

     

    what I will do now is add another dynamic action to check the values of page items to set style (background-color) to certain

    titles.

     

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points