-
Notifications
You must be signed in to change notification settings - Fork 23
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
Scaffolding does not respect display: and editable: fields #62
Comments
I don't think so. I think |
I agree that it makes sense that for show.gsp, it shoudl retrieve the list of properties that are to be visible... so why does show.gsp end up calling getInputProperties, rather than getOutputProperties? and why does getInputProperties check the 'display' property rather than the 'editable' property? |
I don't know the answer to that. I misread the comment and thought you were suggesting the opposite of what you did. That was my mistake. |
@xpusostomos did you found a solution? i have the same problem... |
According to the documentation:
http://docs.grails.org/latest/ref/Constraints/Usage.html
a display: constraint should control whether a property is displayed in scaffolding views.
a editable: constraint should control whether a property can be edited in scaffolding views
When using the default show.gsp scaffolded view,
FormFieldsTagLib line 552 calls domainModelService.getInputProperties(Impl)
This doesn't seem right it calls getINPUTproperties for a show.gsp. Surely a show.gsp should be getOutputProperties?
getInputProperties hard codes the exclusion of dateCreated, lastUpdated and version. Because it is hard coded it doesn't respect your decision to set display: true on those properties. Thus they are not displayed even when display: true is set.
when using the edit.gsp, it also calls the same method, getInputProperties. If I have a field that I do NOT want editable there, I should be able to set editable: false constraint.
However if we look at DomainModelServiceImpl.getInputProperies, it calls getProperties and there it never checks the editable: constraint. It does appear to to check constrained.display... but surely that is the OUTPUT constraint, not the input constraint. It doesn't seem like anywhere in the code it checks the editable constraint.
Task List
Steps to Reproduce
Create a domain object with a few fields, the standard lastUpdated field.
add "display: true" constraint to lastUpdated.
add "editable: false" to some other field.
Generate the standard scaffolding with edit.gsp, show.jsp
Observe that it doesn't respect display: true for lastUpdated
Observe that it doesn't respect editable: false for some other field.
Expected Behaviour
Scaffolded view should respect display: and editable: constraints like the documentation says.
Actual Behaviour
they don't.
Environment Information
The text was updated successfully, but these errors were encountered: