Third Party Library for GWT validation

128 views
Skip to first unread message

abdul

unread,
May 18, 2015, 8:06:11 AM5/18/15
to google-we...@googlegroups.com

I want to validate the gwt field like (Email,Text Length,Phone Number,Date & SSN,etc..) Is there any proven JS or Library Available for Validating this fields with GWT.

  • I Can't use GWT Validation FrameworkorGWT Errai for my application since i am getting response as JSON not DTO.
  • Even I tried Parsley JS(http://parsleyjs.org/ ) which is not possible (Reason:GWT have {key,value} pair to set the attribute but parsley have only value.)

    Any suggestion?

Chad Vincent

unread,
May 18, 2015, 11:49:48 AM5/18/15
to google-we...@googlegroups.com
Are you not marshalling the response into a POJO?  GWT Validation can be done (with most validators, though not all) client-side.

Mohammed Sameen

unread,
May 19, 2015, 2:07:15 AM5/19/15
to google-we...@googlegroups.com
Yes Chad,I can't use GWT Validation(my application response is in the JSON format not in POJO)..

Freddy Boucher

unread,
May 20, 2015, 2:06:54 AM5/20/15
to google-we...@googlegroups.com
The way you request your server doesn't matter...
The GWT Validation Framework allows you to test your fields in both front-end and back-end.
As soon as you test your fields, you will get an error list.

Chad Vincent

unread,
May 20, 2015, 10:40:17 AM5/20/15
to google-we...@googlegroups.com
So you never convert the JSON to a POJO client side?  (GWT responses use GSON, a Google-modified JSON, and are converted to POJO post-receive.)

My best suggestion then is to just walk the JSON as a Map and use a custom validator interface...

Thomas Broyer

unread,
May 20, 2015, 11:05:04 AM5/20/15
to google-we...@googlegroups.com, ccrvi...@gmail.com


On Wednesday, May 20, 2015 at 4:40:17 PM UTC+2, Chad Vincent wrote:
(GWT responses use GSON, a Google-modified JSON, and are converted to POJO post-receive.)

Huh!?!?!?!

GWT-RPC uses its own serialization formats (plural: server-to-client is based on JS object literals –there's a patch to move to pure JSON, but it hasn't been merged yet IIRC– whereas client-to-server is completely custom; anyway, those are custom formats: https://drive.google.com/open?id=1eG0YocsYYbNAtivkLtcaiEE5IOF5u4LUol8-LL0TIKU&authuser=0 )
RequestFactory uses JSON, but with a custom structure; so let's call it a custom format as well.

GSON is an open-source Java library, by Google, for working with JSON; nothing to do with a "Google-modified JSON": https://github.com/google/gson

Chad Vincent

unread,
May 20, 2015, 11:11:06 AM5/20/15
to google-we...@googlegroups.com
Huh.  It's been a few years since I was in the raw serialization bits.  I must've got things confused.

Actually, that serialization format looks like what I remember seeing of HL7.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/neqUQmNGcBg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages