Question on whitespaces in h:outputText and h:inputText [duplicate]
I am getting issue somthing h:outputText
and h:inputText
both are displaying values but they are collapse the multiple whitespaces into single white space
for that i tried with style="white-space:pre"
but it also not working
in between strings
String str="hi & nbsp jsf"
and
<h:inputtext value="#{bean.str}">
while displaying it shows in input text box with value "hi & nbsp ;jsf" not "hi jsf" So, what should i have to do so that that it will display without "& nbsp;"
actually i have put that space between & nbsp; because here it will replaceing with white space
I don't want <h:outputText>
with escape="false"
for displaying because at some place i need h:inputText
. In h:inputText
there is no option for escape attribute
any other permanent solution for white Space Issue
I had the same problem and through trial and error was able to get around it by adding a style to my outputText:
<h:outputText style="white-space:pre;" value="My Text Here"/>
I hope this helps!
the white spaces from outputText are there if you look at the source code.
it sounds like you do not want to escape but you want to escape everything else, which you cant. you cant have the cookie and eat it too.
sounds like this is a ui problem that you should handle with html/css
精彩评论