You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You would except to be able to do something like this: <f:display bean="challenge" except="[]" />
and see id, dateCreated, and dateUpdated
Furthermore, I believe you would expect FormFieldsTagLib.resolvePersistentProperties to call domainModelService.geOutputProperties(domainClass)`
as it is defined as The list of {@link DomainProperty} instances that are to be visible
I realize that there should be some synergy between the edit and the view page and such a change could be followed by requiring attrs.except like was done for #257 However, it is a feature I am constantly looking for because I have no way of knowing the dateCreated and dateUpdated as well as the id (unless I look at the url).
Since the display tag already calls FormFieldsTagLib.resolvePersistentProperties implementing this fix is as simple as
Creating an enum FormFieldsTagLib.PropertiesType = { LIST, OUTPUT, INPUT }
Following the work done on #257
You would except to be able to do something like this:
<f:display bean="challenge" except="[]" />
and see id, dateCreated, and dateUpdated
Furthermore, I believe you would expect
FormFieldsTagLib.resolvePersistentProperties
to call domainModelService.geOutputProperties(domainClass)`as it is defined as
The list of {@link DomainProperty} instances that are to be visible
I realize that there should be some synergy between the edit and the view page and such a change could be followed by requiring attrs.except like was done for #257 However, it is a feature I am constantly looking for because I have no way of knowing the dateCreated and dateUpdated as well as the id (unless I look at the url).
Since the display tag already calls
FormFieldsTagLib.resolvePersistentProperties
implementing this fix is as simple asenum FormFieldsTagLib.PropertiesType = { LIST, OUTPUT, INPUT }
private List<PersistentProperty> resolvePersistentProperties(PersistentEntity domainClass, Map attrs, boolean list = false) {
to
private List<PersistentProperty> resolvePersistentProperties(PersistentEntity domainClass, Map attrs, PropertiesType propertiesType = PropertiesType.INPUT ) {
and modifying the method
properties = propertiesType == PropertiesType.LIST ? domainModelService.getListOutputProperties(domainClass) : propertiesType == PropertiesType.INPUT ? domainModelService.getInputProperties(domainClass) : domainModelService.getOutputProperties(domainClass) // If 'except' is not set, but 'list' is, exclude 'id', 'dateCreated' and 'lastUpdated' by default List<String> blacklist = attrs.containsKey('except') ? getList(attrs.except) : (propertiesType == PropertiesType.LIST ? ['id', 'dateCreated', 'lastUpdated'] : [])
Then changing the existing calls to
FormFieldsTagLib.resolvePersistentProperties
in 2 locations
def display = { attrs, body ->
resolvePersistentProperties(domainClass, attrs, PropertiesType.OUTPUT)
and
private List<String> resolvePropertyNames(PersistentEntity domainClass, Map attrs) {
List<String> properties = resolvePersistentProperties(domainClass, attrs, PropertiesType.INPUT)*.name
The text was updated successfully, but these errors were encountered: