Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Input validation - decoration / visual feedback - howto(How to get visual feedback / decoration on input fields)
Input validation - decoration / visual feedback - howto [message #1049212] Thu, 25 April 2013 10:10 Go to next message
Eclipse UserFriend
The RAP Examples Demo includes input fields with ClientScripting, giving what it describes as 'visual feedback' on fields:

http://rap.eclipsesource.com/rapdemo/examples#input

Note how the "digits only" example gives you an orange background and also a small red 'X' graphic on its top left.

Could someone please explain (better, give an example), on how the 'X' graphic is provided?
Is this done in JavaScript with ClientScripting, or is that image put in by explicit logic (with a Label widget) on the RAP server side using Java code?

Thanks, John

[Updated on: Thu, 25 April 2013 10:11] by Moderator

Re: Input validation - decoration / visual feedback - howto [message #1049812 is a reply to message #1049212] Fri, 26 April 2013 05:51 Go to previous messageGo to next message
Eclipse UserFriend
Hi

> Is this done in JavaScript with ClientScripting, or is that image put in
> by explicit logic (with a Label widget) on the RAP server side?


The examples on the "input"[1] page are Java-only, see here[2], line 108.

On the "validation" page [3] we also use ClientScripting for faster
feedback, except on the first field. Find the Java
(ValidationExamplePage.java) and JavaScript code here[4].

You can also import the Examples demo from your target platform[5] to
view the code, but the bundle with the "validation" page is in the
ClientScripting repository[6].

To show that decorator by ClientScripting is not possible in 2.0
(without dirty tricks), but probably will be in 2.1. (The issue is that
the script can only access the widget that fires the event.)

Hope that helps :-)

Greetings,
Tim


[1] http://rap.eclipsesource.com/rapdemo/examples#input
[2]
http://git.eclipse.org/c/rap/org.eclipse.rap.git/tree/examples/org.eclipse.rap.examples.pages/src/org/eclipse/rap/examples/pages/InputExamplePage.java?id=2.0.0-R-20130205
[3] http://rap.eclipsesource.com/rapdemo/examples#validation
[4]
http://git.eclipse.org/c/rap/incubator/org.eclipse.rap.incubator.clientscripting.git/tree/bundles/org.eclipse.rap.demo.clientscripting/src/org/eclipse/rap/demo/clientscripting/internal
[5]
http://eclipse.org/rap/developers-guide/devguide.php?topic=examples.html&version=2.0
[6] http://eclipse.org/rap/incubator/
--
Tim Buschtöns

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Input validation - decoration / visual feedback - howto [message #1049886 is a reply to message #1049812] Fri, 26 April 2013 08:02 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Tim.
Java-only is good - I wasn't aware of the jface.fieldassist ControlDecoration and FieldDecoration classes, so I think you've pointed me in the right direction.
I cannot get it working in my own application, but it is most likely just me doing something silly... I shall persevere.
Everything builds and runs ok, but I just don't see the images appear... must be me I guess...
Cheers, John
Re: Input validation - decoration / visual feedback - howto [message #1051861 is a reply to message #1049886] Mon, 29 April 2013 05:48 Go to previous messageGo to next message
Eclipse UserFriend
Once again, thanks Tim, all is working now, with custom decorations in SWT and RAP.
I just wonder when Tabris will support them... do you happen to know, or shall I ask on their Forum?
Cheers, John
Re: Input validation - decoration / visual feedback - howto [message #1051943 is a reply to message #1051861] Mon, 29 April 2013 08:02 Go to previous message
Eclipse UserFriend
Hi.


> I just wonder when Tabris will support them... do you happen to know, or
> shall I ask on their Forum?

It's currently not planned, but feel free to open a feature request:
https://github.com/eclipsesource/tabris/issues

Greetings,
Tim

--
Tim Buschtöns

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:[2.1] How to get IP from client?
Next Topic:Is it RAP still working with Juno 4.2.2
Goto Forum:
  


Current Time: Wed Jul 23 14:30:52 EDT 2025

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

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

Back to the top