Text control for dates [message #1816776] |
Wed, 06 November 2019 11:52  |
Eclipse User |
|
|
|
Hello,
We have a text control for dates which has a VerifyListener attached to it but we are running into issues every time the end user starts quickly typing in values in the control. Has anyone else run into this issue? If so what you did to alleviate it? How are people in general handling date based text controls in RAP?
I am thinking of writing a script importing a 3rd party javascript library which will apply the formatting to the input being entered. How do I import the library into my Java RAP project? Do I just add it to the src/main/resources? Another option I can think of is to zero in on a formatting and apply it to the input.
The next question was how to to handle key board short cuts, say for instance, if I type in 'd' then I should get the current date. Should I keep implementing ClientListener for KeyUp and have another script take care of that?
Thanks
[Updated on: Wed, 06 November 2019 11:56] by Moderator
|
|
|
|
Re: Text control for dates [message #1817230 is a reply to message #1816971] |
Mon, 18 November 2019 12:19  |
Eclipse User |
|
|
|
Ivan Furnadjiev wrote on Wed, 13 November 2019 08:37
Hi,
why not using DateTime widget for it? If you need Text based solution with validation, you can use scripting to do the validation on the client [1].
[1] https://github.com/eclipse/rap/blob/master/examples/org.eclipse.rap.examples.pages/src/org/eclipse/rap/examples/pages/internal/scripting/CustomBehaviors.java
Regards,
Ivan
Thanks for the reply. We need to allow user to type in the date as well need to allow them to type in some shortcut keys. I'll look into the custom validation you pointed to. Seems like I need to learn some regular expressions.
|
|
|
Powered by
FUDForum. Page generated in 0.03329 seconds