8000 [Form] Improving default values in embedded forms · Issue #7072 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Improving default values in embedded forms #7072

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

Closed
alvarezmario opened this issue Feb 14, 2013 · 10 comments
Closed

[Form] Improving default values in embedded forms #7072

alvarezmario opened this issue Feb 14, 2013 · 10 comments

Comments

@alvarezmario
Copy link
Contributor

If I have a form 'A' which has an embedded form 'B' that map an object, and that object has defaults values in the constructor, with the current implementation I lose those defaults values when displaying the 'A' form. Of course this is bad...

Is there a way to fix this?

@vicb
Copy link
Contributor
vicb commented Feb 15, 2013

Could you please submit a test case ?

The best would be a PR with a failing TC - or a least a gist. (The TC should be minimal and contains only the requires step to reproduce the issue)

@alvarezmario
Copy link
Contributor Author

@vicb This is not a bug, it's a feature request. I have some ideas for the
implementation. I'll try to do it this weekend.

2013/2/15 Victor Berchet notifications@github.com

Could you please submit a test case ?

The best would be a PR with a failing TC - or a least a gist. (The TC
should be minimal and contains only the requires step to reproduce the
issue)


Reply to this email directly or view it on GitHubhttps://github.com//issues/7072#issuecomment-13609129.

@stof
Copy link
Member
stof commented Feb 15, 2013

Well, you ask for a way to "fix" things. If it is a feature request and not a bug report, there is nothing to fix but something to implement.

and does the default value of the form A contains an object for B created with its default values or does it contain null ?

@vicb
Copy link
Contributor
vicb commented Feb 15, 2013

@Nomack84 have you searched the issue tracker for a similar demand ? There might be some similar "issues" IIRC.

@webmozart
Copy link
Contributor

Why would you lose the default values of the object's constructor?

@alvarezmario
Copy link
Contributor Author

@stof By "fix" I mean that maybe I was doing something wrong. Maybe wasn't the right word to use.
@vicb No, I don't. I'll take a look in the Featured tags of the Form.
@bschussek Well, the real problem is when I add the form with javascript to a collection. The prototype of the form doesn't carry the defaults. Maybe a fix could be creating instances of the objects, which solves the constructor defaults, and them generating the prototype for the collection. I'm not really sure.

@stof
Copy link
Member
stof commented Feb 22, 2013

for the prototype defaults, see #6910

@webmozart
Copy link
Contributor

So is this a duplicate of #5095 really?

@alvarezmario
Copy link
Contributor Author

But then you need to rewrite the defaults values in the form...isn't that ugly? As I say, I'm not sure if is possible to implement what I suggest, but I think is doable.

@alvarezmario
Copy link
Contributor Author
6935

@bschussek Yes, I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0