Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:10 Go to next message
John Gymer is currently offline John GymerFriend
Messages: 279
Registered: November 2012
Location: UK
Senior Member
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


---
Just because you can doesn't mean you should

[Updated on: Thu, 25 April 2013 14:11]

Report message to a moderator

Re: Input validation - decoration / visual feedback - howto [message #1049812 is a reply to message #1049212] Fri, 26 April 2013 09:51 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
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 12:02 Go to previous messageGo to next message
John Gymer is currently offline John GymerFriend
Messages: 279
Registered: November 2012
Location: UK
Senior Member
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


---
Just because you can doesn't mean you should
Re: Input validation - decoration / visual feedback - howto [message #1051861 is a reply to message #1049886] Mon, 29 April 2013 09:48 Go to previous messageGo to next message
John Gymer is currently offline John GymerFriend
Messages: 279
Registered: November 2012
Location: UK
Senior Member
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


---
Just because you can doesn't mean you should
Re: Input validation - decoration / visual feedback - howto [message #1051943 is a reply to message #1051861] Mon, 29 April 2013 12:02 Go to previous message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
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: Fri Apr 19 21:11:55 GMT 2024

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

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

Back to the top