Hi all..

I saw GWTTiger, but this doesn't work with complex masks, then I found
jQuery Mask and Money plugins. These two have a fine-grained mask
sintax.

http://digitalbush.com/projects/masked-input-plugin/
http://inovaideia.com.br/maskInputMoney/

See what I did:

public abstract class Presenter extends Composite {
        private String name;

        public Presenter(String name) {
                this.name = name;

                initWidget(getWidget());
        }

        public String getName() {
                return name;
        }

        public void maskCurrency()      {
                DeferredCommand.addCommand(new Command() {
                        public void execute() {
                                
jQueryMaskCurrency(getWidget().getElement().getId(),
SiteManager.getNumberConstants().monetarySeparator(),
SiteManager.getNumberConstants().monetaryGroupingSeparator());
                        }
                });
        }

        private native void jQueryMaskCurrency(String id, String decimal,
String thousands)/*-{
                $wnd.jQuery(function($) {
                        $wnd.jQuery("#" + id).maskMoney
({"decimal":decimal,"thousands":thousands,showSymbol:false});
                });
        }-*/;

        public void mask(final String mask)     {
                DeferredCommand.addCommand(new Command() {
                        public void execute() {
                                jQueryMask(getWidget().getElement().getId(), 
mask);
                        }
                });
        }

        private native void jQueryMask(String id, String mask)/*-{
                $wnd.jQuery(function($) {
                        $wnd.jQuery("#" + id).mask(mask);
                });
        }-*/;

        protected abstract Widget getWidget();
        public abstract void setEnable(boolean enabled);
        public abstract String getValue();
        public abstract void setValue(String value);
}


On 30 nov, 17:22, "yunhui song" <[EMAIL PROTECTED]> wrote:
> If you use gwt-ext, you can use Ext.mask or Ext.unmask. I have a open source
> project which use that.
>  http://code.google.com/p/ppl-kit
>
> you can get the working code there.
>
> Sammi
>
> On Sun, Nov 30, 2008 at 2:29 AM, Riyaz Mansoor <[EMAIL PROTECTED]>wrote:
>
>
>
> > I'm interested in this as well.
>
> > On Nov 29, 12:15 am, jsantaelena <[EMAIL PROTECTED]> wrote:
> > > Hi
>
> > > Someone knows libe withmaskedwidgets?
>
> > > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to