Regarding key filter

Community Driven Extensions Project
Post Reply
vineet
Posts: 387
Joined: 14 Oct 2011, 23:40

20 Mar 2012, 18:05

Hi ,

I am using key filter to prevent user from entering invalid data . I just wanted to know if it is possible to add the message so that it is easy to understand that invalid character has been typed .

Using PF 3.2 ,

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

21 Mar 2012, 09:18

Do you want "live" messages during typing as I described in my blog? http://ovaraksin.blogspot.de/2011/07/fi ... input.html

Maybe you can also use test function. See 3. example with

Code: Select all

<pe:keyFilter for="autoComplete1" testFunction="return c == 'z';"/>  // c - input by user character
In the test function you can write if / else block. "if" for valid characteres and "else" for invalid. You can use p:remoteCommand in the else block and update p:growl / p:message(s) in case of wrong typed data.
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 “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests