You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by laredotornado <la...@gmail.com> on 2009/11/13 18:20:28 UTC

A telephone tag?

Hi,

I'm using MyFaces 1.1.9.  Is there a pre-built tag somewhere that can
validate a US telephone number field of the form "XXX-XXX-XXXX" where "X" is
a number?  This seems like something that would have been done many times
before.

Thanks, - Dave
-- 
View this message in context: http://old.nabble.com/A-telephone-tag--tp26340146p26340146.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: A telephone tag?

Posted by Cagatay Civici <ca...@gmail.com>.
How about a client side solution?

http://digitalbush.com/projects/masked-input-plugin/

On Fri, Nov 13, 2009 at 6:16 PM, Anton Gavazuk <an...@gmail.com>wrote:

> Dave,
>
> you can create your own tags - although its not easy task,
> what I'm trying to say - you can validate entered values by your custom
> validator/already existed validators
>
> example of custom validator
>
> http://www.google.ch/url?sa=t&source=web&ct=res&cd=3&ved=0CBIQFjAC&url=http%3A%2F%2Fwww.ibm.com%2Fdeveloperworks%2Flibrary%2Fj-jsf3%2F&ei=MqL9St3lPI_9_AaQ4pyeCw&usg=AFQjCNH5n_jGbSVdI3LhXqy6BQpCvUXzRg&sig2=RfmB_K2aqcKN0Y-ERKQJKw
>
> Unfortunately I dont have an example of Myfaces Commons validator.
>
>
> 2009/11/13 laredotornado <la...@gmail.com>
>
> >
> > I appreciate the fact that you are responding but you realize the second
> > link
> > is basically an empty page and neither contains examples.
> >
> > I think what you are trying to say is that there are no such tags as the
> > ones I'm searching for and I'll have to write them myself.  - Dave
> >
> >
> >
> > Anton Gavazuk wrote:
> > >
> > > http://wiki.apache.org/myfaces/Extensions/Validator/
> > > http://myfaces.apache.org/commons12/myfaces-validators12/index.html
> > >
> > > 2009/11/13 laredotornado <la...@gmail.com>
> > >
> > >>
> > >> Could you provide some examples?  I'm looking to create and validate
> > some
> > >> common fields, such as phone number, email address, US state (possibly
> > >> from
> > >> a select menu of all states) and country.  It seems that those types
> of
> > >> things would have been tackled before and I would not need to
> re-invent
> > >> the
> > >> wheel.
> > >>
> > >> Thanks, - Dave
> > >>
> > >>
> > >>
> > >> Anton Gavazuk wrote:
> > >> >
> > >> > Myfaces Common RegExp validator will validate everything what you
> want
> > >> or
> > >> > you can even write your own.
> > >> >
> > >> > 2009/11/13 laredotornado <la...@gmail.com>
> > >> >
> > >> >>
> > >> >> Hi,
> > >> >>
> > >> >> I'm using MyFaces 1.1.9.  Is there a pre-built tag somewhere that
> can
> > >> >> validate a US telephone number field of the form "XXX-XXX-XXXX"
> where
> > >> "X"
> > >> >> is
> > >> >> a number?  This seems like something that would have been done many
> > >> times
> > >> >> before.
> > >> >>
> > >> >> Thanks, - Dave
> > >> >> --
> > >> >> View this message in context:
> > >> >> http://old.nabble.com/A-telephone-tag--tp26340146p26340146.html
> > >> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> > >> >>
> > >> >>
> > >> >
> > >> >
> > >>
> > >> --
> > >> View this message in context:
> > >> http://old.nabble.com/A-telephone-tag--tp26340146p26340389.html
> > >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> > >>
> > >>
> > >
> > >
> >
> > --
> > View this message in context:
> > http://old.nabble.com/A-telephone-tag--tp26340146p26340778.html
> > Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >
> >
>

Re: A telephone tag?

Posted by Anton Gavazuk <an...@gmail.com>.
Dave,

you can create your own tags - although its not easy task,
what I'm trying to say - you can validate entered values by your custom
validator/already existed validators

example of custom validator
http://www.google.ch/url?sa=t&source=web&ct=res&cd=3&ved=0CBIQFjAC&url=http%3A%2F%2Fwww.ibm.com%2Fdeveloperworks%2Flibrary%2Fj-jsf3%2F&ei=MqL9St3lPI_9_AaQ4pyeCw&usg=AFQjCNH5n_jGbSVdI3LhXqy6BQpCvUXzRg&sig2=RfmB_K2aqcKN0Y-ERKQJKw

Unfortunately I dont have an example of Myfaces Commons validator.


2009/11/13 laredotornado <la...@gmail.com>

>
> I appreciate the fact that you are responding but you realize the second
> link
> is basically an empty page and neither contains examples.
>
> I think what you are trying to say is that there are no such tags as the
> ones I'm searching for and I'll have to write them myself.  - Dave
>
>
>
> Anton Gavazuk wrote:
> >
> > http://wiki.apache.org/myfaces/Extensions/Validator/
> > http://myfaces.apache.org/commons12/myfaces-validators12/index.html
> >
> > 2009/11/13 laredotornado <la...@gmail.com>
> >
> >>
> >> Could you provide some examples?  I'm looking to create and validate
> some
> >> common fields, such as phone number, email address, US state (possibly
> >> from
> >> a select menu of all states) and country.  It seems that those types of
> >> things would have been tackled before and I would not need to re-invent
> >> the
> >> wheel.
> >>
> >> Thanks, - Dave
> >>
> >>
> >>
> >> Anton Gavazuk wrote:
> >> >
> >> > Myfaces Common RegExp validator will validate everything what you want
> >> or
> >> > you can even write your own.
> >> >
> >> > 2009/11/13 laredotornado <la...@gmail.com>
> >> >
> >> >>
> >> >> Hi,
> >> >>
> >> >> I'm using MyFaces 1.1.9.  Is there a pre-built tag somewhere that can
> >> >> validate a US telephone number field of the form "XXX-XXX-XXXX" where
> >> "X"
> >> >> is
> >> >> a number?  This seems like something that would have been done many
> >> times
> >> >> before.
> >> >>
> >> >> Thanks, - Dave
> >> >> --
> >> >> View this message in context:
> >> >> http://old.nabble.com/A-telephone-tag--tp26340146p26340146.html
> >> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://old.nabble.com/A-telephone-tag--tp26340146p26340389.html
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/A-telephone-tag--tp26340146p26340778.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Re: A telephone tag?

Posted by Jan-Kees van Andel <ja...@gmail.com>.
You can try the PrimeFaces <p:inputMask /> component. It's really nice:
http://97.107.138.40:8080/prime-showcase/ui/inputMask.jsf

Regards,
Jan-Kees


2009/11/17 Bart Kummel <bk...@gmail.com>:
> I think the easiest way to get your phone number validation is to use a
> regular expression validator, such as
> <tr:validateRegExp><http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateRegExp.html>.
> You can use google search to find a good regular expression to validate
> phone numbers. I found this one
> <http://regexlib.com/REDetails.aspx?regexp_id=458>for example.
>
> Best regards,
> Bart Kummel
>
> On Fri, Nov 13, 2009 at 19:05, laredotornado <la...@gmail.com>wrote:
>
>>
>> I appreciate the fact that you are responding but you realize the second
>> link
>> is basically an empty page and neither contains examples.
>>
>> I think what you are trying to say is that there are no such tags as the
>> ones I'm searching for and I'll have to write them myself.  - Dave
>>
>>
>>
>> Anton Gavazuk wrote:
>> >
>> > http://wiki.apache.org/myfaces/Extensions/Validator/
>> > http://myfaces.apache.org/commons12/myfaces-validators12/index.html
>> >
>> > 2009/11/13 laredotornado <la...@gmail.com>
>> >
>> >>
>> >> Could you provide some examples?  I'm looking to create and validate
>> some
>> >> common fields, such as phone number, email address, US state (possibly
>> >> from
>> >> a select menu of all states) and country.  It seems that those types of
>> >> things would have been tackled before and I would not need to re-invent
>> >> the
>> >> wheel.
>> >>
>> >> Thanks, - Dave
>> >>
>> >>
>> >>
>> >> Anton Gavazuk wrote:
>> >> >
>> >> > Myfaces Common RegExp validator will validate everything what you want
>> >> or
>> >> > you can even write your own.
>> >> >
>> >> > 2009/11/13 laredotornado <la...@gmail.com>
>> >> >
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> I'm using MyFaces 1.1.9.  Is there a pre-built tag somewhere that can
>> >> >> validate a US telephone number field of the form "XXX-XXX-XXXX" where
>> >> "X"
>> >> >> is
>> >> >> a number?  This seems like something that would have been done many
>> >> times
>> >> >> before.
>> >> >>
>> >> >> Thanks, - Dave
>> >> >> --
>> >> >> View this message in context:
>> >> >> http://old.nabble.com/A-telephone-tag--tp26340146p26340146.html
>> >> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://old.nabble.com/A-telephone-tag--tp26340146p26340389.html
>> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/A-telephone-tag--tp26340146p26340778.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
>

Re: A telephone tag?

Posted by Bart Kummel <bk...@gmail.com>.
I think the easiest way to get your phone number validation is to use a
regular expression validator, such as
<tr:validateRegExp><http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateRegExp.html>.
You can use google search to find a good regular expression to validate
phone numbers. I found this one
<http://regexlib.com/REDetails.aspx?regexp_id=458>for example.

Best regards,
Bart Kummel

On Fri, Nov 13, 2009 at 19:05, laredotornado <la...@gmail.com>wrote:

>
> I appreciate the fact that you are responding but you realize the second
> link
> is basically an empty page and neither contains examples.
>
> I think what you are trying to say is that there are no such tags as the
> ones I'm searching for and I'll have to write them myself.  - Dave
>
>
>
> Anton Gavazuk wrote:
> >
> > http://wiki.apache.org/myfaces/Extensions/Validator/
> > http://myfaces.apache.org/commons12/myfaces-validators12/index.html
> >
> > 2009/11/13 laredotornado <la...@gmail.com>
> >
> >>
> >> Could you provide some examples?  I'm looking to create and validate
> some
> >> common fields, such as phone number, email address, US state (possibly
> >> from
> >> a select menu of all states) and country.  It seems that those types of
> >> things would have been tackled before and I would not need to re-invent
> >> the
> >> wheel.
> >>
> >> Thanks, - Dave
> >>
> >>
> >>
> >> Anton Gavazuk wrote:
> >> >
> >> > Myfaces Common RegExp validator will validate everything what you want
> >> or
> >> > you can even write your own.
> >> >
> >> > 2009/11/13 laredotornado <la...@gmail.com>
> >> >
> >> >>
> >> >> Hi,
> >> >>
> >> >> I'm using MyFaces 1.1.9.  Is there a pre-built tag somewhere that can
> >> >> validate a US telephone number field of the form "XXX-XXX-XXXX" where
> >> "X"
> >> >> is
> >> >> a number?  This seems like something that would have been done many
> >> times
> >> >> before.
> >> >>
> >> >> Thanks, - Dave
> >> >> --
> >> >> View this message in context:
> >> >> http://old.nabble.com/A-telephone-tag--tp26340146p26340146.html
> >> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://old.nabble.com/A-telephone-tag--tp26340146p26340389.html
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/A-telephone-tag--tp26340146p26340778.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Re: A telephone tag?

Posted by laredotornado <la...@gmail.com>.
I appreciate the fact that you are responding but you realize the second link
is basically an empty page and neither contains examples.

I think what you are trying to say is that there are no such tags as the
ones I'm searching for and I'll have to write them myself.  - Dave



Anton Gavazuk wrote:
> 
> http://wiki.apache.org/myfaces/Extensions/Validator/
> http://myfaces.apache.org/commons12/myfaces-validators12/index.html
> 
> 2009/11/13 laredotornado <la...@gmail.com>
> 
>>
>> Could you provide some examples?  I'm looking to create and validate some
>> common fields, such as phone number, email address, US state (possibly
>> from
>> a select menu of all states) and country.  It seems that those types of
>> things would have been tackled before and I would not need to re-invent
>> the
>> wheel.
>>
>> Thanks, - Dave
>>
>>
>>
>> Anton Gavazuk wrote:
>> >
>> > Myfaces Common RegExp validator will validate everything what you want
>> or
>> > you can even write your own.
>> >
>> > 2009/11/13 laredotornado <la...@gmail.com>
>> >
>> >>
>> >> Hi,
>> >>
>> >> I'm using MyFaces 1.1.9.  Is there a pre-built tag somewhere that can
>> >> validate a US telephone number field of the form "XXX-XXX-XXXX" where
>> "X"
>> >> is
>> >> a number?  This seems like something that would have been done many
>> times
>> >> before.
>> >>
>> >> Thanks, - Dave
>> >> --
>> >> View this message in context:
>> >> http://old.nabble.com/A-telephone-tag--tp26340146p26340146.html
>> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/A-telephone-tag--tp26340146p26340389.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/A-telephone-tag--tp26340146p26340778.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: A telephone tag?

Posted by Anton Gavazuk <an...@gmail.com>.
http://wiki.apache.org/myfaces/Extensions/Validator/
http://myfaces.apache.org/commons12/myfaces-validators12/index.html

2009/11/13 laredotornado <la...@gmail.com>

>
> Could you provide some examples?  I'm looking to create and validate some
> common fields, such as phone number, email address, US state (possibly from
> a select menu of all states) and country.  It seems that those types of
> things would have been tackled before and I would not need to re-invent the
> wheel.
>
> Thanks, - Dave
>
>
>
> Anton Gavazuk wrote:
> >
> > Myfaces Common RegExp validator will validate everything what you want or
> > you can even write your own.
> >
> > 2009/11/13 laredotornado <la...@gmail.com>
> >
> >>
> >> Hi,
> >>
> >> I'm using MyFaces 1.1.9.  Is there a pre-built tag somewhere that can
> >> validate a US telephone number field of the form "XXX-XXX-XXXX" where
> "X"
> >> is
> >> a number?  This seems like something that would have been done many
> times
> >> before.
> >>
> >> Thanks, - Dave
> >> --
> >> View this message in context:
> >> http://old.nabble.com/A-telephone-tag--tp26340146p26340146.html
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/A-telephone-tag--tp26340146p26340389.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Re: A telephone tag?

Posted by laredotornado <la...@gmail.com>.
Could you provide some examples?  I'm looking to create and validate some
common fields, such as phone number, email address, US state (possibly from
a select menu of all states) and country.  It seems that those types of
things would have been tackled before and I would not need to re-invent the
wheel.

Thanks, - Dave



Anton Gavazuk wrote:
> 
> Myfaces Common RegExp validator will validate everything what you want or
> you can even write your own.
> 
> 2009/11/13 laredotornado <la...@gmail.com>
> 
>>
>> Hi,
>>
>> I'm using MyFaces 1.1.9.  Is there a pre-built tag somewhere that can
>> validate a US telephone number field of the form "XXX-XXX-XXXX" where "X"
>> is
>> a number?  This seems like something that would have been done many times
>> before.
>>
>> Thanks, - Dave
>> --
>> View this message in context:
>> http://old.nabble.com/A-telephone-tag--tp26340146p26340146.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/A-telephone-tag--tp26340146p26340389.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: A telephone tag?

Posted by Anton Gavazuk <an...@gmail.com>.
Myfaces Common RegExp validator will validate everything what you want or
you can even write your own.

2009/11/13 laredotornado <la...@gmail.com>

>
> Hi,
>
> I'm using MyFaces 1.1.9.  Is there a pre-built tag somewhere that can
> validate a US telephone number field of the form "XXX-XXX-XXXX" where "X"
> is
> a number?  This seems like something that would have been done many times
> before.
>
> Thanks, - Dave
> --
> View this message in context:
> http://old.nabble.com/A-telephone-tag--tp26340146p26340146.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>