- This topic has 6 replies, 3 voices, and was last updated 14 years, 2 months ago by support-shalini.
-
AuthorPosts
-
amir55Participanthi
I am using the renderer simple example to change the color of the ouput code using this java renderer
package renderer ;
public class BlueOutputRenderer extends OutputModificationRenderer {
public String doModification(String value) {
value = “<font color=\’red\’>” + value + “</font>”; // not changing clor why?
return(value);
}
}The bug is the output value is shown but with no color change instead it adds the html code as it s to the value. why ?
how could I append the above simple line to work ?
do not worry about the super class OutputModificationRenderer as it is fine and general
so many thanks
Amir
support-shaliniMemberAmir,
Are you setting the output of BlueOutputRenderer in any JSP using c:out?
In that case, the tag has an escapeXml attribute that should be set to false.
Please refer to the following link for further reference –
http://publib.boulder.ibm.com/infocenter/wchelp/v5r6/index.jsp?topic=/com.ibm.commerce.developer.doc/refs/rsdjspbpescapexml.htm
support-joyMemberAmir,
Can you refresh the page after rendering? Probably you need to execute an event to ensure the color change.
amir55Participantdear all
thank you but the refresh is not working.
I do not use c:out but the jsf outputText
<h:outputText value=”#{msgs.quote1}”></h:outputText>
the msgs is for the resourceBundle.proerties to pass a hello world message.
many thanks if you know a certain site or reason.
Amir
support-shaliniMemberAmir,
You can use escape=”false”
Please refer to
http://www.roseindia.net/jsf/outputText.shtml
amir55Participanthi dear
still the escape is not working
simply how to get outputText to run html code
greeting=Hello World! // defined in resoulceBundle
<h:outputText value=”#{msgs.greeting}” escape=”false” ></h:outputText>
public class BlueOutputRenderer extends OutputModificationRenderer {
public String doModification(String value) {
value = “<font color=\’red\’>” + value + “</font>”;
return(value);
}
}the jsf should display Hello World in red color but instead I get the html code in red on the browser
“<font color=\’red\’>” Hello World “</font>”;
lots of thanks
Amir
support-shaliniMemberAmir,
This looks more like a development issue, can you cross post the relevant forums? -
AuthorPosts