MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
amir55
Post subject: Renderer simple color bug  PostPosted: Aug 27, 2010 - 08:46 AM
Registered Member
Registered Member


Joined: Oct 15, 2005
Posts: 208

hi

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
 
 View user's profile Send private message  
Reply with quote Back to top
support-shalini
Post subject: RE: Renderer simple color bug  PostPosted: Aug 27, 2010 - 11:42 AM
Registered Member
Registered Member


Joined: May 18, 2009
Posts: 1532

Amir,
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

_________________
Shalini
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
support-joy
Post subject: RE: Renderer simple color bug  PostPosted: Aug 27, 2010 - 12:27 PM
Registered Member
Registered Member


Joined: Feb 03, 2009
Posts: 3442

Amir,

Can you refresh the page after rendering? Probably you need to execute an event to ensure the color change.

_________________
Joy
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
amir55
Post subject:   PostPosted: Aug 29, 2010 - 07:23 AM
Registered Member
Registered Member


Joined: Oct 15, 2005
Posts: 208

dear 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
 
 View user's profile Send private message  
Reply with quote Back to top
support-shalini
Post subject:   PostPosted: Aug 30, 2010 - 06:59 AM
Registered Member
Registered Member


Joined: May 18, 2009
Posts: 1532

Amir,
You can use escape="false"
Please refer to
http://www.roseindia.net/jsf/outputText.shtml

_________________
Shalini
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
amir55
Post subject:   PostPosted: Aug 30, 2010 - 09:57 AM
Registered Member
Registered Member


Joined: Oct 15, 2005
Posts: 208

hi 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
 
 View user's profile Send private message  
Reply with quote Back to top
support-shalini
Post subject:   PostPosted: Aug 31, 2010 - 06:50 AM
Registered Member
Registered Member


Joined: May 18, 2009
Posts: 1532

Amir,
This looks more like a development issue, can you cross post the relevant forums?

_________________
Shalini
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits