www.webdeveloper.com
Results 1 to 8 of 8

Thread: part of string in different color

  1. #1
    Join Date
    Apr 2005
    Posts
    132

    part of string in different color

    <c:set var="typeTitle" value="${acctType}${openParen}${req}${closeParen}"/>

    display:column title="${typeTitle}">
    ...................
    .................

    Would like to put (*) in red.

    i.e
    ${acctType} in default color but
    ${openParen}${req}${closeParen}" in red.

    how to do this?

    Thanks.

  2. #2
    Join Date
    Nov 2005
    Location
    127.0.0.1
    Posts
    329
    umm, not quite sure what language that is, but I'd assume you could do this:

    ${acctType}
    <span style="color: #CC0000">${openParen}${req}${closeParen}</span>
    my computer suffers from short-term memory loss.

  3. #3
    Join Date
    Apr 2005
    Posts
    132

    using JSTL too.

    using JSTL and displaytag.

    yah I tried using the span in the value in cut tag but didn't work. can this be done using javascript? I am not sure how to call the js func from JSTL.

  4. #4
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    What was the resulting output when you used the span? Maybe you need to escape the brackets.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  5. #5
    Join Date
    Apr 2005
    Posts
    132
    what do I have to do to escape the bracket?

    I am seeing as a comlipation error. IDE shows it as a undetermined <c:set> tag.
    is this what you mean by escape?

    <c:set var="typeTitle" value="${acctType}"<span style="color: #CC0000">"${openParen}${req}${closeParen}</span>"/>

    Thanks.

  6. #6
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Maybe \< and \>. Oh, I just noticed the quotes. Have you tried like so?

    <c:set var="typeTitle" value="${acctType}<span style='color: #CC0000'>${openParen}${req}${closeParen}</span>"/>

    Otherwise try.

    <c:set var="typeTitle" value="${acctType}\<span style='color: #CC0000'\>${openParen}${req}${closeParen}\</span\>"/>

    I'm just guessing though. I do Java/JSPs but no experience with that tag.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  7. #7
    Join Date
    Apr 2005
    Posts
    132
    thank you for responding. but, that didn't work either.

    Any other suggessions?

    Thanks.

  8. #8
    Join Date
    Apr 2005
    Posts
    132
    got the solution finally

    <c:set var="spanred" value="<span style='color: #CC0000'>"/>
    <c:set var="spanend" value="</span>"/>

    <display:column title="${acctTypeTitle}${spanred}${openParen}${req}${closeParen}${spanend}">


    Thank you all for responding.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles