Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Binder: Auto-grow collections as needed to support nested property binding [SPR-6033] #10702

Closed
spring-projects-issues opened this issue Aug 24, 2009 · 1 comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Aug 24, 2009

Keith Donald opened SPR-6033 and commented

Grails, SpEL, and the new PresentationModel under development for 3.1 all include this feature. We should consider building this natively into DataBnder to benefit existing users & so Grails particularly no-longer has to maintain its own extensions.

Scenario illustrating feature behavior:

Alternate scenario:

  • Attempting to bind to index property path bar.baz[5] = 'hello'; say baz is not null, but only has a size of 1 at index = 0.
  • In this scenario, new default instances of the List's parameterized type e.g. String in the case of List<String> will be added at index 1..3; baz[4] would then be set to 'hello'.

As a developer, this frees me from having to pre-populate a indexed object graph ahead of time when binding back a Form post; I can simply rely on what the client is submitting to drive the population of the object graph. This is convenient


Affects: 3.0 M4

Issue Links:

Referenced from: commits 3fa533d

1 votes, 2 watchers

@spring-projects-issues
Copy link
Collaborator Author

Keith Donald commented

Added auto-growth for arrays and Lists to BeanWrapper when "autoGrowNestedPaths" is true. Support for sets and Maps will be considered and addressed in a separate JIRA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant