Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rendering h:outputText with partial boldness  RSS feed

 
Pete Whitmore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm doing a fulltext search page and I want to highlight the searchpattern within the resulting output which is displayed in a table.

eg search value is *123* and the resultvalue would be aaabbbb1234cccc. What I'd like to see is aaabbbb1234cccc.

I tried to add the html to the resultsString in my backing bean:
 
Pete Whitmore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ooops...Wasn't finished before hitting enter/submit...

ie return "aaabbb<b>123</b>4ccc";

and putting this out in the value of my hutputText:

ie <hutputText value="#{searchBean.result.value}"/>

This obviously doesnt't work I just get aaabbb<b>123</>4ccc. The html source has of course all the escape values for gt and lt.

Anyone know what I can do apart from make several return values and outputtexts for one string?

Thanks in advance.
Peter
 
Pete Whitmore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry case of rtfm:

solution is to set the escape to false in the outputText.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!