webtier@glassfish.java.net

Re: [webtier] h:outputLabel adding unwanted newline character to label content

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Wed, 24 Feb 2010 16:58:11 -0800

Hello,

The renderkit specification doesn't require it. Haven't dug through the
history to see if there's a reason yet, but I'd recommend logging an
issue [1].

[1] https://javaserverfaces.dev.java.net

On 2/24/10 12:24 PM, webtier_at_javadesktop.org wrote:
> I've just come back to JSF after a multi-year absence so I'm still feeling my way a bit, but there is one thing that's current niggling me.
>
> Is there a good reason why Mojarra 2.0.2 adds a new line character in front of the content of every<h:outputLabel> element?
>
> That results in this:
>
> [b]<h:outputLabel for="rememberMe" value="Remember Me"/>[/b]
>
> becoming this:
>
> [b]<label for="rememberMe">
> Remember Me</label>[/b]
>
> instead of this:
>
> [b]<label for="rememberMe">Remember Me</label>[/b]
>
> While Firefox ignores the \n character in most cases, if you put a label after, say, a checkbox field, the \n is converted into a space character, and there is no way to get rid of it. It's hard coded into the Renderkit source (LabelRenderer.java line 118):
>
> writer.writeText("\n", component, null);
>
> Is this a bug or a feature of the JSF spec? It seems to me that the only reason why you would add a newline was to make a source code more readable, in which case it should be added before the open label tag, not after it.
> [Message sent by forum member 'tacitust' (tacitus_at_yahoo.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=388506
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>