At the moment, when you create an in-place editable property for the property of an object but the object doesn’t exist yet, simply nothing is displayed where the edit field should be. I propose to change this with the following new features:
- Support
data-object-policy="updateOrCreate"
to enable object creation when the property is saved (transforms intoobjectPolicy=updateOrCreate
parameter on save) ineditableProperty.js
. -
editableProperty.js
uses thedisplay.vm
template to display the value both in edit and view mode so this needs to support not-yet-existing objects by displaying the default value (currently, nothing is displayed). Internally,display.vm
calls#displayObjectProperty
fromdisplay_macros.vm
. I see two options:- Just create a new object in
#displayObjectProperty
if no existing object is found, i.e., change its behavior (currently, the behavior is to just output nothing) - Also pass the
objectPolicy
parameter (or another parameter) todisplay.vm
and translate this into a new option for#displayObjectProperty
that would trigger the behavior to create an object if it doesn’t exist yet.
- Just create a new object in
While the first option is easier to implement, the second option has the advantage not to change existing behavior. Do you have any preferences?
I need this feature for enabling heading numbering either in the info tab if the New User Interface Extension Point (UIXP) for Page Information should be accepted or in an additional tab otherwise. I would like to re-use the existing UI and backend to avoid creating redundant code and to make it consistent for the user while hiding the complexity that the object that stores the configuration might not exist yet.