This discussion is archived
9 Replies Latest reply: Jul 11, 2011 1:19 AM by Joel_C RSS

Conditional Formatting link

747993 Newbie
Currently Being Moderated
Hello,

I have link in my application:
decode( E.ST_ID, 2, 
'<a href="f?p=&APP_ID.:31:&SESSION.::&DEBUG.::P31_ZEM_ID,P31_KSI:' || E.ID ||','||K.ID  || '">Wypożycz</a>' , 'Książka wypożyczona nie można pozyczyć ! ') as link,
And now I want to set the format as below:
when E.ST_ID = 2 THEN 'GREEN LNIK'
WHEN E.ST_ID <> 2 THEN 'RED LINK'

I tried this way:
decode( E.ST_ID, 2, 
'<a href="f?p=&APP_ID.:31:&SESSION.::&DEBUG.::P31_ZEM_ID,P31_KSI:' || E.ID ||','||K.ID  || '">Wypożycz</a>' , 'Książka wypożyczona nie można pozyczyć ! ') as link,
CASE
WHEN E.ST_ID = '2' THEN 'GREEN'
WHEN E.ST_ID <>'2' THEN 'RED'
END THE_COLOR
And set the html expression of this column as follows:
<span style="color:#THE_COLOR#;font-weight:bold;">#LINK#</span>
And now a column changes color, but link is not link only text.
  • 1. Re: Conditional Formatting link
    fac586 Guru
    Currently Being Moderated
    To properly render HTML elements generated in queries, set the Display Text As column attribute to Standard Report Column rather than the default Display as Text (escape special characters).
  • 2. Re: Conditional Formatting link
    747993 Newbie
    Currently Being Moderated
    After the change to "Display Text As column attribute to Standard Report Column" nothing changes. Text color in link column is correct but ink not working.
  • 3. Re: Conditional Formatting link
    fac586 Guru
    Currently Being Moderated
    Well the link posted:
    <a href="#">Wypożycz</a>
    obviously goes nowhere. If it's actually something other than this then you need to provide more information. Try to reproduce the problem on apex.oracle.com.
  • 4. Re: Conditional Formatting link
    747993 Newbie
    Currently Being Moderated
    when e.st_id the value is equal to '2' then to show a link. Otherwise, you have to show the word 'Książka wypożyczona nie można pozyczyć ! ' and link is not avaiable.
  • 5. Re: Conditional Formatting link
    fac586 Guru
    Currently Being Moderated
    when e.st_id the value is equal to '2' then to show a link. Otherwise, you have to show the word 'Książka wypożyczona nie można pozyczyć ! ' and link is not avaiable.
    Understood, but <tt>&lt;a href="#"&gt;</tt> links to the same page. I'm suggesting you attempt to reproduce the problem on apex.oracle.com, so that we can see exactly what's going on.
  • 6. Re: Conditional Formatting link
    747993 Newbie
    Currently Being Moderated
    I don't have any account on apex.oracle.com.
    It was not comlete link. I do not know why but the forum converts it and do not know how to get around. This is comlete link in 2 parts
    decode( E.ST_ID, 2, 
    '<a href
    ="f?p=&APP_ID.:31:&SESSION.::&DEBUG.::P31_ZEM_ID,P31_KSI:' || E.ID ||','||K.ID  || '">Wypożycz</a>' , 'Książka wypożyczona nie można pozyczyć ! ') as link
    Edited by: wilow on 2011-07-08 07:40
  • 7. Re: Conditional Formatting link
    Joel_C Pro
    Currently Being Moderated
    This is a bit of a bugbear for me - when someone says something is "not working" without adding further information. I mean, if you said to a mechanic that your car "isn't working", there's a big difference between, say, the immobilizer being jammed, and the petrol tank having a leak - the latter bursting into flames being the ultimate expression of a car "not working"...

    To bring it back to the point, how do you know the link "isn't working"? What behaviours are manifesting (or not manifesting) that tell you the desired result isn't being achieved? Does the link attempt to open a page (but it's the wrong one)? Does it appear as a link at all (i.e. something you can click on) or just as plain text?

    You will need to be more specific about it before someone will be able to assist you more.
  • 8. Re: Conditional Formatting link
    747993 Newbie
    Currently Being Moderated
    When I added html expression Link was not a link. Normal link works if not I will add formatting html. when I added the formatting i see green text 'wypozycz', but it is not a link- only text
  • 9. Re: Conditional Formatting link
    Joel_C Pro
    Currently Being Moderated
    Okay. Why not try firstly creating a normal, hard-coded link (to something like the OTN home page) - ignore the decode element for the time being and see if you can get that to work. If it does, try introducing the 'decode' element but still with the hard coded link. If that works, try again with the dynamically-generated link. I'm sure the solution will present itself thereafter.

Legend

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