Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Input masking on Text
Input masking on Text [message #900399] Mon, 06 August 2012 21:00 Go to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
Has anybody tried to add input masking on a Text widget?

There seems to be a lack of documentation for creating custom widgets for RAP 1.5. I've also read there can be issues taking the easy route of creating Browser based widgets when using the SimpleLifeCycle.

I've bad a look at the Nebula port of the Date combo and server-side input masking doesn't work very well, even with the browser on the same machine as the server (I assume because Modify listeners are always triggered after a delay).

It was fairly easy to shove a jQuery input mask library on a GWT component but I imagine it wouldn't be so simple with RAP.

Is there an easy way to subclass Text, add a property to hold the mask and some javascript to initialise the widget?
Re: Input masking on Text [message #900432 is a reply to message #900399] Tue, 07 August 2012 05:45 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Chris,
did you try SWT.PASSWORD style flag on the Text widget?
HTH,
Ivan

On 8/7/2012 12:00 AM, Chris Fairhall wrote:
> Has anybody tried to add input masking on a Text widget?
>
> There seems to be a lack of documentation for creating custom widgets
> for RAP 1.5. I've also read there can be issues taking the easy route
> of creating Browser based widgets when using the SimpleLifeCycle.
>
> I've bad a look at the Nebula port of the Date combo and server-side
> input masking doesn't work very well, even with the browser on the
> same machine as the server (I assume because Modify listeners are
> always triggered after a delay).
>
> It was fairly easy to shove a jQuery input mask library on a GWT
> component but I imagine it wouldn't be so simple with RAP.
>
> Is there an easy way to subclass Text, add a property to hold the mask
> and some javascript to initialise the widget?

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Input masking on Text [message #900628 is a reply to message #900432] Tue, 07 August 2012 20:17 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
Sorry, I could have phrased my question better.
When I said input mask I meant something like this: http://digitalbush.com/projects/masked-input-plugin/

I've tried slightly modifying that script to fire the input's listeners when it intercepts the key events but its only working on IE. In Firefox none of the listeners RAP adds to the input field get fired so the widget is effectively broken.
It works surprisingly well on IE7
Re: Input masking on Text [message #900670 is a reply to message #900628] Wed, 08 August 2012 06:26 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Chris,
if you need an input validation [1] you could make it in two ways - pure
client validation (client scripting [2]) or server verify listener.
[1] http://rap.eclipsesource.com/rapdemo/examples#validation
[2] http://wiki.eclipse.org/RAP/ClientScripting
HTH,
Ivan

On 8/7/2012 11:17 PM, Chris Fairhall wrote:
> Sorry, I could have phrased my question better.
> When I said input mask I meant something like this:
> http://digitalbush.com/projects/masked-input-plugin/
> I've tried slightly modifying that script to fire the input's
> listeners when it intercepts the key events but its only working on
> IE. In Firefox none of the listeners RAP adds to the input field get
> fired so the widget is effectively broken.
> It works surprisingly well on IE7

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Could not evaluate javascript response
Next Topic:how to achieve right-click menu close all in the view header?
Goto Forum:
  


Current Time: Fri Apr 26 08:31:01 GMT 2024

Powered by FUDForum. Page generated in 0.03091 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top