dev@javaserverfaces.java.net

Re: h:inputTextArea swallows one leading newline

From: Manfred Riem <manfred.riem_at_oracle.com>
Date: Tue, 30 Apr 2013 10:44:12 -0500

Hi Daniel,

Thank you for filing the issue. We'll be taking care of it as time
permits :)

Manfred

On 4/29/2013 9:26 AM, Daniel Lichtenberger wrote:
> Hi Manfred,
>
> Filed as JAVASERVERFACES-2858:
> https://java.net/jira/browse/JAVASERVERFACES-2858
>
> Daniel
>
> On 04/23/2013 10:41 PM, Manfred Riem wrote:
>> Hi Daniel,
>>
>> Can you file an JIRA issue requesting this?
>>
>> Thanks!
>> Manfred
>>
>> On 4/19/2013 1:42 AM, Daniel Lichtenberger wrote:
>>> Hi Manfred,
>>>
>>> Sound nice - I'm not sure about the attribute name, since it requires
>>> that the user already knows the solution to the problem. Maybe
>>> "preserveLeadingNewlines" or something along these lines?
>>>
>>> Thanks,
>>> Daniel
>>>
>>>
>>> On 04/18/2013 04:12 PM, Manfred Riem wrote:
>>>> 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
>>>>>>
>>>>>
>>>>
>>