textarea limit character

UI Components for JSF
Post Reply
pauga
Posts: 22
Joined: 03 Jun 2011, 08:49

06 Jun 2011, 10:39

Hi,

Now I´m working with primefaces 3.0 and I want to propose a new feature. Now, i´m using a script to set a limit on the number of characters a user can enter into a textarea. But, I think it would be a good idea try to include a similar mechanism into the textarea component.

This mechanism only has to limit the character that I user can enter, and show a description with the characters left.

If anyone knows a mechanism to do this with primefaces, please tell me.

Thanks in advance.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

06 Jun 2011, 11:27

Hi,

We disscussed that a couple of time ago. I think there is an issue in the issue tracker (can't find it).

I proposed to use:

http://viralpatel.net/blogs/2008/12/set ... cript.html
http://www.stjerneman.com/demo/maxlength-with-jquery
http://www.uize.com/examples/slider-chars-used.html

Each of those scripts / plugins is cool (especially the last one).

- Oleg.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

pauga
Posts: 22
Joined: 03 Jun 2011, 08:49

06 Jun 2011, 12:02

I was looking for the issue, but I cannot find id.

I think I´m going to use something like the third script, but it would be nice if something like that was implemented directly on primefaces.

thanks for the reply

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

06 Jun 2011, 14:00

Yes, you can create an issue if you want.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

GuitarBrasil
Posts: 221
Joined: 04 Aug 2011, 22:00

05 Sep 2011, 01:23

it would be a greatefull idea if we have a property on inputTextArea with which would give us this functionality! Let's pray for it!
PrimeFaces 3.5 + JSF 2.1.4 + Tomcat 7.X

rajsharan
Posts: 7
Joined: 09 Feb 2012, 17:34

11 Feb 2012, 21:59

Has this been implemented yet?

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

11 Feb 2012, 23:16

Yes. p:textArea, attribute "maxlength". But I read that it doesn't work if you paste text from clipboard. It only works if you type character by character.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests