Dan Haywood created ISIS-941:
--------------------------------

             Summary: Wicket viewer shouldn't try to flush properties that are 
disabled.
                 Key: ISIS-941
                 URL: https://issues.apache.org/jira/browse/ISIS-941
             Project: Isis
          Issue Type: Bug
          Components: Viewer: Wicket
    Affects Versions: viewer-wicket-1.6.0
            Reporter: Dan Haywood
            Assignee: Dan Haywood
            Priority: Minor
             Fix For: viewer-wicket-1.8.0


This broke in 1.6.0 because of https://issues.apache.org/jira/browse/ISIS-837

https://github.com/apache/isis/blob/0af3219129076161143bd388e3fc3ec039cbed79/component/viewer/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityModel.java#L582

There are two conflicting requirements.  In some cases we want a derived 
property to appear to be editable... so that it udpates other stuff.  In other 
cases the derived property is not editable, so we should do nothing.

In 
https://github.com/apache/isis/blob/1b10065e7fefc591e7e510ecb7a5ea6dba17f485/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertySetAndClearFacetFactory.java#L78
 we install a NotPersistedFacetInferred if there is no setter/clear.

That is correct... we use "isNotPersisted" on OneToOneAssociation in several 
places (eg IsisTransaction#enlist..., and PersistedAlgorithmDefault) in order 
to ensure we only deal with properties that have "backing" data.

The fix in ISIS-837 is correct so far as it goes  It's not enough 
EntityModel#apply to go looking for the NotPersistedFacet, because as the 
comment from ISIS-837 and the first use case says, in these cases we DO want to 
flush the changes into the Isis runtime.

However, EntityModel#apply must also account for the property being disabled 
(which is inferred from it not having any setter/clear facets, see 
DisabledFacetOnPropertyInferredFacetFactory).





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to