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

Is dynamic scaffolding for embedded object broken in grails 3? #215

Closed
mailbin opened this issue Jul 26, 2016 · 3 comments
Closed

Is dynamic scaffolding for embedded object broken in grails 3? #215

mailbin opened this issue Jul 26, 2016 · 3 comments

Comments

@mailbin
Copy link

mailbin commented Jul 26, 2016

Hi,

I'm having problem with dynamic scaffolding for embedded class in the create/edit form. When I open the create/edit page, the html declaration <!doctype html><html> and the closing </html> are missing. Using the simple example from grails doc page:

class Person {
    Address homeAddress
    static embedded = ['homeAddress']
}

class Address {
    String street
}

Then I try overriding the embedded template in layouts/_fields/embedded.gsp:

<fieldset class="embedded ${g.pageProperty(name:'type')}">
    Test
    <g:layoutBody/>
</fieldset>

I am still having the same problem. If I remove <g:layoutBody/> part, the <html></html> appears again. However I cannot see the embedded fields.

Embedding class also seems to be broken in a freshly generated grails app. After embedding a child class inside a parent class, the create/edit form shows up as blank page in the browser page. Did I miss anything?

@sbglasius
Copy link
Member

This does not appear to have anything to do with the Fields plugin. Please submit example where the Fields Plugin is used.

@valnaumov
Copy link

valnaumov commented May 30, 2017

@sbglasius please take a look at this issue grails/scaffolding#12 it has an example attached with views generated by scaffolding plugin. the issue is still present as of Grails 3.2.6

seems like <f:all> is causing problems, because if i declare embedded field with f:field, it works fine.

@pleonar3
Copy link

pleonar3 commented Apr 3, 2019

@sbglasius please take a look at this issue grails3-plugins/scaffolding#12 it has an example attached with views generated by scaffolding plugin. the issue is still present as of Grails 3.2.6

seems like <f:all> is causing problems, because if i declare embedded field with f:field, it works fine.

At this point I'm not convinced there's much of a gain to using an embedded class at all. It would be just as easy to generate the view, use display: false, and then just customize/specialize the view for the specific properties.

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

No branches or pull requests

4 participants