ValidateNestedProperties

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ValidateNestedProperties

Adam Stokar
Hi all,

Is it possible to Validate nested properties within a nested property?

For example:

@ValidateNestedProperties({

@Validate(field="eventType", required=false, converter=CalendarEventTypeTypeConverter.class),

@Validate(field="repeatEvent.repeatType", required=false, converter=RepeatTypeTypeConverter.class)

})

private CalendarEvent calendarEvent;

eventType validates correctly, but repeatEvent.repeatType does not leaving me with a null object.  Does anyone have a simple workaround for this?  I'm trying to convert enum classes and the only way I have figured out to get it to work is using type converters.  

Thanks!


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: ValidateNestedProperties

Mike McNally-3
That has worked for me many times. Have you turned on debugging for
the ValidationMetadataProvider class to see what's going on?

On Mon, Nov 10, 2014 at 2:36 PM, Adam Stokar <[hidden email]> wrote:

> Hi all,
>
> Is it possible to Validate nested properties within a nested property?
>
> For example:
>
> @ValidateNestedProperties({
>
> @Validate(field="eventType", required=false,
> converter=CalendarEventTypeTypeConverter.class),
>
> @Validate(field="repeatEvent.repeatType", required=false,
> converter=RepeatTypeTypeConverter.class)
>
> })
>
> private CalendarEvent calendarEvent;
>
> eventType validates correctly, but repeatEvent.repeatType does not leaving
> me with a null object.  Does anyone have a simple workaround for this?  I'm
> trying to convert enum classes and the only way I have figured out to get it
> to work is using type converters.
>
> Thanks!
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
> _______________________________________________
> Stripes-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>



--
Turtle, turtle, on the ground,
Pink and shiny, turn around.

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: ValidateNestedProperties

Adam Stokar
It was my fault.  I didn't have a getter on CalendarEvent.  Oops.  Thanks for the response!

On Mon, Nov 10, 2014 at 4:42 PM, Mike McNally <[hidden email]> wrote:
That has worked for me many times. Have you turned on debugging for
the ValidationMetadataProvider class to see what's going on?

On Mon, Nov 10, 2014 at 2:36 PM, Adam Stokar <[hidden email]> wrote:
> Hi all,
>
> Is it possible to Validate nested properties within a nested property?
>
> For example:
>
> @ValidateNestedProperties({
>
> @Validate(field="eventType", required=false,
> converter=CalendarEventTypeTypeConverter.class),
>
> @Validate(field="repeatEvent.repeatType", required=false,
> converter=RepeatTypeTypeConverter.class)
>
> })
>
> private CalendarEvent calendarEvent;
>
> eventType validates correctly, but repeatEvent.repeatType does not leaving
> me with a null object.  Does anyone have a simple workaround for this?  I'm
> trying to convert enum classes and the only way I have figured out to get it
> to work is using type converters.
>
> Thanks!
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
> _______________________________________________
> Stripes-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>



--
Turtle, turtle, on the ground,
Pink and shiny, turn around.

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users