Does Grails use a (Configurable)WebBindingInitializer and if yes how to customize it...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Does Grails use a (Configurable)WebBindingInitializer and if yes how to customize it...

Marcel Overdijk
I'm using Spring's AutoPopulatingList to populate a list inside a domain class.

Problem is gaps are inside the list (e.g. by submitting item[0].name and item[2].name) are populated with null objects.

In Spring 3.x I would access Spring's ConfigurableWebBindingInitializer and to set AutoGrowNestedPaths to false.

I wonder if Grails is using it's own binding or that is uses Spring MVC's one internally, and hence I wonder how to set AutoGrowNestedPaths to false in Grails?
Reply | Threaded
Open this post in threaded view
|

Re: Does Grails use a (Configurable)WebBindingInitializer and if yes how to customize it...

Lari Hotari -

No, it's not used. Please open a Jira about using WebBindingInitializer
for customizing the data binder. Contributions are also welcome.

We would need to use WebBindingInitializer to fix this issue too:
http://jira.grails.org/browse/GRAILS-9324?focusedCommentId=71932&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-71932

Regards,

Lari



28.09.2012 14:25, Marcel Overdijk wrote:

> I'm using Spring's AutoPopulatingList to populate a list inside a domain
> class.
>
> Problem is gaps are inside the list (e.g. by submitting item[0].name and
> item[2].name) are populated with null objects.
>
> In Spring 3.x I would access Spring's ConfigurableWebBindingInitializer and
> to set AutoGrowNestedPaths to false.
>
> I wonder if Grails is using it's own binding or that is uses Spring MVC's
> one internally, and hence I wonder how to set AutoGrowNestedPaths to false
> in Grails?
>
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Does-Grails-use-a-Configurable-WebBindingInitializer-and-if-yes-how-to-customize-it-tp4635640.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Does Grails use a (Configurable)WebBindingInitializer and if yes how to customize it...

Marcel Overdijk
OK I will do.

Any advise how to use dynamic forms (eg receipt with dynamic number of line items) in current Grails 2.1.1?
Problem is when line[0] and line[3] is submitted Spring's AutoPopulatingList will create not-null Items on position 1 and 2.

Any ideas?
Reply | Threaded
Open this post in threaded view
|

Re: Does Grails use a (Configurable)WebBindingInitializer and if yes how to customize it...

Marcel Overdijk
In reply to this post by Lari Hotari -
Reply | Threaded
Open this post in threaded view
|

Re: Does Grails use a (Configurable)WebBindingInitializer and if yes how to customize it...

Marcel Overdijk
In reply to this post by Marcel Overdijk
Note that as workaround I'm doing this in my controller now:

receipt.items.removeAll([null])

which basically removes the gaps by removing all null objects from the list.