| Author |
How do I prevent this value from getting escaped?
|
Dave Alvarado
Ranch Hand
Joined: Jul 02, 2008
Posts: 434
|
|
Hi,
I'm using MyFaces 1.1.6 withi Tomahawk 1.1.9 on JBoss 5.1. I have
Thing is, if the value is empty, what actually gets output is " ", but I don't want this ... I want " ". However, I do want the value of "contactInfo.organization" to be escaped. Not sure if "escaped" is the right word to use here but hopefully you know what I'm talking about.
Thanks, - Dave
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14491
|
|
I think that you're doing this the hard way. And I'm not 100% sure that EL supports the trinary operator, but I'm too lazy to RTFM.
Just say:
code
<h utputText value="#{contactInfo.organization}"/>
[/code]
If the property value is null or an empty string, nothing will display. Otherwise the value will display. When you said display " ", it took you at your word. Since HTML is normally insensitive to spaces, it forced a space entity ( ) to ensure that what displayed was what you told it to. Notice I didn't say "what you wanted"!
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Dave Alvarado
Ranch Hand
Joined: Jul 02, 2008
Posts: 434
|
|
The reason I asked for a " " is because the structure of the HTML is such that a blank space (" ") will cause the display to look off so I need something there in its place.
That said, I have experimented but it doesn't appear possible to do what I'm asking, unless you know an answer to the question posed.
Thanks, - Dave
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14491
|
|
Dave Alvarado wrote:The reason I asked for a " " is because the structure of the HTML is such that a blank space (" ") will cause the display to look off so I need something there in its place.
That said, I have experimented but it doesn't appear possible to do what I'm asking, unless you know an answer to the question posed.
Thanks, - Dave
Now I'm confused. It appears you don't want a " ", you want a " ", but I don't know the difference between " " and " ".
An outputText element should still occupy a niche, even when displaying a null string, so that wouldn't upset grid and datatable views, so I'm totally
|
 |
 |
|
|
subject: How do I prevent this value from getting escaped?
|
|
|