Abhoryo / APYJsFormValidationBundle

This bundle performs validations of a form in javascript. (i18n compatible and several javascript frameworks supported)
92 stars 23 forks source link

Embedded forms #54

Closed slurx closed 10 years ago

slurx commented 10 years ago

Hello, I am new here and I using for first time this bundle. It works fine but when I have an object Class that contains another object inside, the javascript code is not generated. For Example: If you have an User object that contains a field like UserProfile object, you define the two Form Classes, i.e. UserType and UserProfileType. Inside UserType buildForm method you call to the UserProfile method:

public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('username', 'text'); $builder->add('profile', new ProfileType()); }

This example doesnt work, not throw any errors however doesnt generate any validation rules in the js file.

Sorry If my english is not correct :-P

Lot of thanks! and well done!!

Abhoryo commented 10 years ago

Look the documentation for your symfony version, maybe the validation of subforms isn't set to true.

slurx commented 10 years ago

Hi!, thanks for your response, my symfony version is 2.3.8, and in my test code in UserProfileType I set cascade_validation to true, it is necesary anything else?,

Lot of thanks!

Abhoryo commented 10 years ago

I don't know, sorry. Read the RedMe file. Use the other bundle, it should work with your case.

slurx commented 10 years ago

Ok, thanks ;-), must I close this issue?

Abhoryo commented 10 years ago

No, it's good.