beberlei / AcmePizzaBundle

Acme Form Experimental Bundle
131 stars 27 forks source link

Example using Event Listeners in forms #33

Open dcsg opened 13 years ago

dcsg commented 13 years ago

Hi, i'm facing a situation that i need to use event listeners, i would like to know if is possible to implement it in this bundle to show how it works?

In my situation i need it to select cities based on the county and country selection first.

I have follow this article without success: http://webb-on-the-web.com/?p=5

I sent an email to ML but i didn't got any response yet, i would like to help in this feature and in others. I created a gist maybe could help explain the situation: https://gist.github.com/1127540

In AcmePizzaBundle, we can try to implement a detailed address for the client with the city and state using event listeners what do you think?

Thanks in advance,

Daniel Gomes

brikou commented 13 years ago

Why not validate address against google map services? If you'd like some kind of select field why not use a auto-complete plugin and keep field as regular text?

btw your given example using listener is very interesting but for acmePizza we still have to allow order edition afterward

dcsg commented 13 years ago

@brikou, in my case, i need to list companies by location/city and i have all the cities that was provided by portugal postal services.

Regular text can make redundancy entries in database, in my database i will not allow users to add cities, countys they are already set.

I just need a way to pick them by country -> county -> city i thought event listeners could do the job, but i was seeing that they aren't change the data in the city choice field.

I would like to implement it for AcmePizza, but we can create a more general case and maybe not so complicated with only state and city for example, what do you think?

cordoval commented 13 years ago

is there an update on this or can I post my solution or at least what I have?