Skip to content

[Form] extend the documentation on dynamic form modification #2238

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
luebbert42 opened this issue Feb 14, 2013 · 14 comments
Closed

[Form] extend the documentation on dynamic form modification #2238

luebbert42 opened this issue Feb 14, 2013 · 14 comments
Labels
actionable Clear and specific issues ready for anyone to take them. Form

Comments

@luebbert42
Copy link
Contributor

I suggest to add the following information either to the documentation or the cookbook

  • details on the different event times (when to use what)
  • example: how to pass data to the event listener using Doctrine entities/not using entities
  • information: how to set the order of the added form elements (possible at all or responsibility of the template?)

I am referring to http://symfony.com/doc/current/cookbook/form/dynamic_form_modification.html

@weaverryan
Copy link
Member

Hi Dorthe!

+1 for details on different event times (when to use what)
+1 for making sure we're showing at least one outside "thing" being made accessible to the event listener, whether this is some outside data or a service
-1 for the re-ordering - I believe this is the responsibility right now (for better or worse) of the template

We should review the document and make these changes, but only after #1842 has been merged in.

Thanks!

@luebbert42
Copy link
Contributor Author

Ryan, that's perfectly fine that ordering is done in the template, but it should be noted somewhere. My English is sometimes ... interesting... but if I can support you somehow in preparing something, let me know :-)

@weaverryan
Copy link
Member

This issue is ready to be worked on - there are additional changes needed in #2464.

@cheesemacfly
Copy link

I do believe the YAML configuration sample at the end of this page has some typos.

@xabbuh
Copy link
Member

xabbuh commented Jun 21, 2013

@cheesemacfly what do you mean?

@cheesemacfly
Copy link

@xabbuh Shouldn't the @doctrine argument for acme.form.meetup_registration_listener be @doctrine.orm.entity_manager instead?

@wouterj
Copy link
Member

wouterj commented Jun 21, 2013

@cheesemacfly you're completely correct. There is already a fix for that in #2743

@cheesemacfly
Copy link

@wouterj you are right. Thanks for the information!

@weaverryan
Copy link
Member

I've just merged in that fix! I'm going to close this issue - my intention was to use #2464 going forward to follow the issues with this entry.

Thanks!

@barnibx
Copy link

barnibx commented Feb 11, 2014

Hi guys,

would you be kind, and share the link where I can find these additional documentation?
I'm getting issues build up that example based on just those information from the cookbook (http://symfony.com/doc/current/cookbook/form/dynamic_form_modification.html).

Thank you in advance.

@xabbuh
Copy link
Member

xabbuh commented Feb 11, 2014

Hi @barnibx, which additional documentation are you talking about?

@barnibx
Copy link

barnibx commented Feb 11, 2014

Hi @xabbuh,
I was referring to @weaverryan 's comment, on:
+1 for details on different event times (when to use what)
+1 for making sure we're showing at least one outside "thing" being made accessible to the event listener, whether this is some outside data or a service
-1 for the re-ordering - I believe this is the responsibility right now (for better or worse) of the template.

I realized after my comments, that I can check the modifications on each issue (#xxc), but I was wondering if these additions can be found in one place with some examples.

Thanks for your question.

@weaverryan
Copy link
Member

Hey @barnibx - these have all been put into different parts in this article: http://symfony.com/doc/current/cookbook/form/dynamic_form_modification.html. We more or less addressed these issues, but we don't talk directly about, for example, when to use the different form events (that article uses FormEvents::PRE_SET_DATA several times). If there's something missing that you'd like to see, please definitely open an issue :).

Cheers!

@barnibx
Copy link

barnibx commented Feb 11, 2014

HI @weaverryan,

Thanks for your response.
Maybe I missed something, but I think it would be really useful if you could add an example/explanation how can be built a dynamic form with changing more fields depending on another field.
For example if I have a list of checkboxes for a country regions, and each region has his own fields which needs to be completed. So what would be a nice solution(based on form events) to show different twig templates on each region selection.
I understand that this will affect different sections (entities, controllers, twig templates, AJAX calls) but I think this tutorial it would make some developer's life much easier :)

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. Form
Projects
None yet
Development

No branches or pull requests

6 participants