You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by rmattler <Ro...@gmail.com> on 2008/02/28 16:26:27 UTC

New quy question on converting input data

If a phone number is input as (330) 555-1212 on the form when the form is
saved I want the data stored as 3305551212 in the database and when
displayed again on the form as (330) 555-1212.

As a bonus how do I would like data entered as 3305551212 and converted to
(330) 555-1212 on the onBlur event.  

What is the "Wicket Way" to do this.
-- 
View this message in context: http://www.nabble.com/New-quy-question-on-converting-input-data-tp15738847p15738847.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: New quy question on converting input data

Posted by Igor Vaynberg <ig...@gmail.com>.
you can use a converter for serverside stuff. see
formcomponent.setconverter() and iconverter. for clientside you can
either create a behavior or subclass textfield, override
oncomponenttag and do tag.put("onblur", myjavascript);

-igor


On Thu, Feb 28, 2008 at 7:26 AM, rmattler <Ro...@gmail.com> wrote:
>
>  If a phone number is input as (330) 555-1212 on the form when the form is
>  saved I want the data stored as 3305551212 in the database and when
>  displayed again on the form as (330) 555-1212.
>
>  As a bonus how do I would like data entered as 3305551212 and converted to
>  (330) 555-1212 on the onBlur event.
>
>  What is the "Wicket Way" to do this.
>  --
>  View this message in context: http://www.nabble.com/New-quy-question-on-converting-input-data-tp15738847p15738847.html
>  Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>  For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org