xpusostomos opened a new issue, #14270:
URL: https://github.com/apache/grails-core/issues/14270

   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
   
   - **Grails Version:** 4.0.11
   - **JDK Version:** 1.8
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to