Command objects that aren't nested

36 views
Skip to first unread message

Antony Stubbs

unread,
Apr 8, 2011, 10:15:10 AM4/8/11
to JQuery Validation UI Plugin
Is there a way to also validate extra command objects, which aren't
nested in the domain class?

Chee Kin Lim

unread,
Apr 8, 2011, 10:24:39 AM4/8/11
to jquery-valida...@googlegroups.com
Yes, the <jqvalui:renderValidationScript /> support domain class or command object as documented in http://code.google.com/p/jquery-validation-ui-plugin/#Tags, but only for a form per domain class or command object.

Hope this help.

Regards,
Chee Kin

Antony Stubbs

unread,
Apr 8, 2011, 10:28:42 AM4/8/11
to jquery-valida...@googlegroups.com
Yes, I guess that's what I'm asking. I have a form that uses both a non-nested command object _and_ a domain object. I can't validate both?

Chee Kin Lim

unread,
Apr 8, 2011, 10:48:18 PM4/8/11
to jquery-valida...@googlegroups.com
Can server-side validation have two separate command objects or domain classes under one form?

Best regards,
Chee Kin

Antony Stubbs

unread,
Apr 8, 2011, 11:48:39 PM4/8/11
to jquery-valida...@googlegroups.com, jquery-valida...@googlegroups.com
I believe so, but you might have to call validate() manually?

Chee Kin Lim

unread,
Apr 9, 2011, 1:48:19 AM4/9/11
to jquery-valida...@googlegroups.com
Believe so? please tried it out and let's me know ...

Even multiple command objects/domain classes validation is supported by Grails, unluckily the plugin didn't support this use case as I didn't have this requirement. There are two ways you can fix this issue:
1) Consolidate the domain classes or command objects to one class.
2) Modify the plugin to support this use case, you can do so by support more than one class in "for" attribute of <jqvalui:renderValidationScript /> tag.

If you go for item 2 above, please contribute back the modification to the plugin.

Thanks.

Best regards,
Chee Kin

limcheekin

unread,
Apr 12, 2011, 10:56:37 PM4/12/11
to JQuery Validation UI Plugin
Hi Antony,

May I know are you managed to solve this issue?

Best regards,
Chee Kin


On Apr 9, 1:48 pm, Chee Kin Lim <limchee...@vobject.com> wrote:
> Believe so? please tried it out and let's me know ...
>
> Even multiple command objects/domain classes validation is supported by
> Grails, unluckily the plugin didn't support this use case as I didn't have
> this requirement. There are two ways you can fix this issue:
> 1) Consolidate the domain classes or command objects to one class.
> 2) Modify the plugin to support this use case, you can do so by support more
> than one class in "for" attribute of <jqvalui:renderValidationScript /> tag.
>
> If you go for item 2 above, please contribute back the modification to the
> plugin.
>
> Thanks.
>
> Best regards,
> Chee Kin
>
> On Sat, Apr 9, 2011 at 11:48 AM, Antony Stubbs <antony.stu...@gmail.com>wrote:
>
> > I believe so, but you might have to call validate() manually?
>
> > On 8/04/2011, at 10:48 PM, Chee Kin Lim <limchee...@vobject.com> wrote:
>
> > Can server-side validation have two separate command objects or domain
> > classes under one form?
>
> > Best regards,
> > Chee Kin
>
> > On Fri, Apr 8, 2011 at 10:28 PM, Antony Stubbs < <antony.stu...@gmail.com>
> > antony.stu...@gmail.com> wrote:
>
> >> Yes, I guess that's what I'm asking. I have a form that uses both a
> >> non-nested command object _and_ a domain object. I can't validate both?
>
> >> On 8/04/2011, at 10:24 AM, Chee Kin Lim wrote:
>
> >> Yes, the <jqvalui:renderValidationScript /> support domain class or
> >> command object as documented in
> >> <http://code.google.com/p/jquery-validation-ui-plugin/#Tags>
> >>http://code.google.com/p/jquery-validation-ui-plugin/#Tags, but only for
> >> a form per domain class or command object.
>
> >> Hope this help.
>
> >> Regards,
> >> Chee Kin
>

Antony Stubbs

unread,
Apr 14, 2011, 1:58:08 PM4/14/11
to jquery-valida...@googlegroups.com, limcheekin
I had already done what Chee suggested - consolidated them both into a
single command object. But I'm still having problems. If in the
"include" variable for specifying what nested objects to include in
validation, it only works for single nested objects, if it's nested
twice, like include="person.address", I get string out of bounds
exceptions :/ I am planning on filing a bug at some point - unless
Chee - you're already aware?

Chee Kin Lim

unread,
Apr 14, 2011, 10:32:40 PM4/14/11
to Antony Stubbs, jquery-valida...@googlegroups.com
Hi Antony,

Thanks for writing.

I not sure I understand the issue, I am very appreciate if you can create a detail bug report at http://code.google.com/p/jquery-validation-ui-plugin/issues/list.

By the way, the person example working well and it has two nested Address object such as workAddress and homeAddress, please correct me if I am wrong.

Antony Stubbs

unread,
Apr 14, 2011, 10:41:29 PM4/14/11
to Chee Kin Lim, jquery-valida...@googlegroups.com
Is there a sample project for that example? I'll gladly create a bug report. 

Chee Kin Lim

unread,
Apr 14, 2011, 10:58:34 PM4/14/11
to jquery-valida...@googlegroups.com
Hi Antony,

Just install the sample app at http://code.google.com/p/jquery-validation-ui-plugin/#The_Person_Sample_Application into any grails project will do.

Best regards,
Chee Kin

Reply all
Reply to author
Forward
0 new messages