How to hide few fields from create.gsp form in grails view folder?

128 Views Asked by At

I want to hide few fields in grails create.gsp file for a table. I cannot use column display false constraint because I want the field to be visible in index page table view.

By default the code for create.gsp contains the following:

            <g:form resource="${this.tablename}" method="POST">
                <fieldset class="form">
                    <f:all bean="tablename"/>
                </fieldset>
                <fieldset class="buttons">
                    <g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" />
                </fieldset>
            </g:form>

How do I skip some specific 2-3 fields in <f:all bean = "tablename"/> part of code?

1

There are 1 best solutions below

1
Jeff Scott Brown On

How do I skip some specific 2-3 fields in <f:all bean = "tablename"/> part of code?

You can exclude attributes using the except attribute of the tag which accepts a comma-separated list of properties that should be skipped.

See https://grails-fields-plugin.github.io/grails-fields/latest/ref/Tags/all.html for more info.