0

I have a input field in primefaces. When user press some keys then it will automatic translate into specific language ex Chinese. The concept is, input field will only accept specific language. Is that possible ??

Here is my code,

<p:inputText id="emergencyCause">
</p:inputText>
<p:watermark for="emergencyCause" value="Cause" id="watermark32" />
Priyantha
  • 3,687
  • 4
  • 21
  • 40
  • I think that currently PrimeFaces don't have any specific component for this functionality. So you will need to do some workaround, my suggestion would be to try it with p:keyboard and allow only specific language to insert. You can also look at Google Input Tools solutions: http://www.google.co.in/inputtools/. Or maybe try to write some converter to achieve this functionality. – JokerTheFourth Oct 09 '17 at 05:57
  • Is there any way which converts whole page including form into selected language? – Shakib Ahmed Oct 09 '17 at 06:02

1 Answers1

1

You can use JSF tag <f:validateRegex> like stated here with regex for Chinese like this or this way.

T. Kryazh
  • 25
  • 1
  • 9