dev@javaserverfaces.java.net

Re: h:inputTextArea swallows one leading newline

From: Manfred Riem <manfred.riem_at_oracle.com>
Date: Thu, 18 Apr 2013 09:12:47 -0500

Hi Daniel,

Would you be OK with something like this?

<h:inputTextarea ....>
   <f:attribute name="addNewLineAtStart" value="true">
</h:inputTextarea>

If so we could add this without changing current behavior and thus
not break backwards compatibility

Let me know what you think about this?

Regards,
Manfred

On 4/18/2013 4:37 AM, Daniel Lichtenberger wrote:
> Hi Manfred,
>
> On 04/11/2013 05:53 PM, Manfred Riem wrote:
>> I would suggest if you want to make sure that you don't lose content to
>> add a \n at the beginning and the end on the server side of your
>> application.
>
> I also tried this, but it gets ugly very quickly (now you need a
> special getter for providing the value to the input).
>
>> Note you probably want to review your pages if you have more than one
>> page using the textarea tag and make sure they are all used in the same
>> way.
>
> I believe the Rails guys fixed this by always writing a newline after
> the opening <textarea> tag, which (I think) would also work in JSF -
> note that the issue is specific to the textarea tag, as it _doesn't_
> trim leading whitespace (except the newline immediately following the
> opening tag).
>
> Daniel
>
>
>>
>> Regards,
>> Manfred
>>
>> On 3/25/2013 2:14 PM, daniel.lichtenberger_at_gmx.net wrote:
>>> Hi Manfred,
>>>
>>> Thanks for the quick reply.
>>>
>>>> If you think the specification and thus the implementation of
>>> h:inputTextarea needs to
>>>> deal with this you probably are looking a specification issue, which
>>> are tracked at
>>>> the JAVASERVERFACES_SPEC_PUBLIC jira issue tracker.
>>> I'm not sure how deep the issue goes - maybe the browser behaviour
>>> depends on the DOCTYPE? Were there any changes in the XML writers? Did
>>> each JSF application since 1.0 have this (admittedly obscure) issue
>>> with textareas? Did older, less standards-conformant browsers behave
>>> differently? I'd like to hear if other people had/have this problem,
>>> too.
>>>
>>> Daniel
>>
>