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

Multiple Forms for one Model #136

Open
bastos71 opened this issue Jan 30, 2018 · 0 comments
Open

Multiple Forms for one Model #136

bastos71 opened this issue Jan 30, 2018 · 0 comments
Labels
Milestone

Comments

@bastos71
Copy link

I think i'm facing a huge error of conception here :/

My problem is that I have one Form Type, but it is rendered multiple times into a single page (in a listing view, inside a table for some reasons)

It seems that the entire Javascript Plugin of JsFormValidatorBundle is built for the logic 1 Model = 1 Form, so when I render a form at least twice (for 2 differents entities for example), the plugin only initializes the first one.
And this seems logic because in the source code, forms are retrieved by Form BlockPrefixes

this.addModel = function (model, onLoad) {
    var self = this;
    if (!model) return;
    if (onLoad !== false) {
        this.onDocumentReady(function () {
            self.forms[model.id] = self.initModel(model);
        });
    } else {
        self.forms[model.id] = self.initModel(model);
    }
};

Anyone's having the same problem ? :/

@66Ton99 66Ton99 added the bug label Jan 31, 2018
@66Ton99 66Ton99 added this to the 2.0 milestone Jan 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants