Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Clientside Input Validation
Clientside Input Validation [message #1065924] Fri, 28 June 2013 06:44 Go to next message
Tiburon T is currently offline Tiburon T
Messages: 53
Registered: October 2011
Member
Hello!

I am trying to integrate the client side input validation into our current RAP 2.0.1 project. I downloaded the 2.0 tagged org.eclipse.clientscripting from git(1). Then I imported the org.eclipse.rap.clientscripting plugin into my workspace and made our own plugin depend on it. I copied the classes CustomBehaviors and ResourceLoaderUtil along with the .js files from the demo project and changed them so that all resources are found and read correctly (I tried org.eclipse.rap.clientscripting.demo as well as org.eclipse.rap.demo.clientscripting). Finally I tried to make a Textfield Digit-Only :
CustomBehaviors.addDigitsOnlyBehavior(inputText);

Unfortunately I get this error when the containing dialog is opened:
Error: Error: Operation "create" on target "cs513" of type "null" failed:
No Handler for type rwt.clientscripting.Listener
Properties: 
code = var handleEvent = function( event ) {

  var regexp = /^[0-9]*$/;
  var text = event.widget.getText();
  if( text.match( regexp ) === null ) {
    event.widget.setBackground( [ 255, 255, 128 ] );
    event.widget.setToolTip( "Only digits allowed!" );
  } else {
    event.widget.setBackground( null );
    event.widget.setToolTip( null );
  }

};


Could somebody please explain to me, what I am missing here?

Thanks,
Tiburon

[1]http://git.eclipse.org/c/rap/incubator/org.eclipse.rap.incubator.clientscripting.git/tag/?id=2.0.0-M4-20121218
Re: Clientside Input Validation [message #1065954 is a reply to message #1065924] Fri, 28 June 2013 09:22 Go to previous messageGo to next message
Thorsten Lichtenwalter is currently offline Thorsten Lichtenwalter
Messages: 12
Registered: February 2013
Junior Member
Obviously there is no registered handler for 'rwt.clientscripting.Listener'. This handler is defined by ListenerAdapter.js which is located in the clientscripting bundle. Did you do any modifications at this bundle? Especially within the class ClientScriptingResources (this one loads all that javascript stuff).



Thorsten Lichtenwalter
Software Development
msgGillardon AG, Bretten, Germany
Re: Clientside Input Validation [message #1065966 is a reply to message #1065954] Fri, 28 June 2013 09:55 Go to previous messageGo to next message
Tiburon T is currently offline Tiburon T
Messages: 53
Registered: October 2011
Member
Hi,

Thanks for your hint!
I left the whole org.eclipse.rap.clientscripting plugin unchanged and even made sure by debugging, that all the contained .js files are loaded properly.
Re: Clientside Input Validation [message #1066161 is a reply to message #1065966] Mon, 01 July 2013 06:04 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim Buschtoens
Messages: 381
Registered: July 2009
Senior Member
Hi.

How did you confirm that the js file is loaded?
Can you check in the network tab of your browsers developer tools if
clientscripting.js is transfered to the client? Are there any other
errors in the javascript console? What browser are you using?

Also, any details regarding your application setup (how is it launched,
do you use workbench) might also help.

Greetings,
Tim

Am 28.06.2013 15:55, schrieb Tiburon T:
> Hi,
>
> Thanks for your hint!
> I left the whole org.eclipse.rap.clientscripting plugin unchanged and
> even made sure by debugging, that all the contained .js files are loaded
> properly.

--
Tim Buschtöns

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Clientside Input Validation [message #1068124 is a reply to message #1066161] Fri, 12 July 2013 05:47 Go to previous message
Tiburon T is currently offline Tiburon T
Messages: 53
Registered: October 2011
Member
Hi!

Thanks for you answer Tim. Unfortunately I didn't have enough time to work on this subject until now, and couldn't reply earlier. But I managed to fix my problem today by switching to the streams/2.0 Version from your git. With that version everythings works as expected.

Thanks,
Tiburon
Previous Topic:Configuring jetty truststore unsuccessful
Next Topic:How to change the alignment image/text in a ToolItem?
Goto Forum:
  


Current Time: Fri Aug 22 03:55:03 EDT 2014

Powered by FUDForum. Page generated in 0.02133 seconds