1

I used Apache Trinidad Component in rendering my mobile user interface. Now I have an inputtext code like this but if it for example the space is constrained (browser rendering) and a carriage return is added in the inputtext

<tr:inputText id="it3" simple="true" required="true"
                                maximumLength="30">
    <tr:convertNumber locale="#{myBean.locale}"
                      minFractionDigits="6"
                      maxFractionDigits="6" />
</tr:inputText>

..I am getting this error

The value must be a number

Based on my investigation, it is the carriage return in the inputtext that causes the conversion error

If for example in my inputtext..I have this data (with carriage return..)

123456789
01

I am getting the error above..

If my data has no carriage return such as this one

12345678901

then no converter error is received. Any thoughts?

[Update] ..or better yet. Is there a way for a JSF Input text not to add carriage return or make it single line only?

Mark Estrada
  • 9,013
  • 37
  • 119
  • 186
  • Could you use JSTL function to replace the carriage return as in [http://stackoverflow.com/questions/7901875/how-can-i-manipulate-a-string-in-a-jsf-tag](http://stackoverflow.com/questions/7901875/how-can-i-manipulate-a-string-in-a-jsf-tag)? – cbayram Mar 11 '14 at 02:12
  • Apparently its not possible as of the moment as we need to stick it out using pure JSF tags..thanks – Mark Estrada Mar 11 '14 at 02:18
  • 1
    I'm confused: are you saying that a html `` contains carriage returns for you? Because, well, the [HTML reference](http://www.w3.org/TR/html-markup/input.text.html#input.text.attrs.value) explicitly says of such values that they are "Any string that contains no line feed (U+000A, “LF”) or carriage return (U+000D, “CR”) characters". Or is trinidad playing tricks on you here by using a ` – mabi Mar 11 '14 at 08:04
  • Regular `h:inputText` is single line and doesn't support carriage return inside. How can you put 2 line text inside in your case (via Copy-Paste)? – Vasil Lukach Mar 11 '14 at 21:59

0 Answers0