[MGNLUI-4233] defaultValues does not work for existing Node without Properties Created: 30/Jun/17  Updated: 11/Jul/17  Resolved: 11/Jul/17

Status: Closed
Project: Magnolia UI
Component/s: dialogs
Affects Version/s: 5.5.3
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Fatha Idrees Assignee: Unassigned
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

defaultValue does not work for Nodes, which already exist. For example a component with an area, the has also a dialog. The area Node ist created with the component Node, so the defaultValues for the area Dialog does not work.



 Comments   
Comment by Richard Gange [ 11/Jul/17 ]

Hi Fatha-

Typically it's a good idea to avoid dialogs on areas. However, I do know there are some cases where it is convenient to attach a dialog to an area template. But I would try to avoid them if you can.

The defaultValue property is used for populating the dialog fields. They will not be persisted until the user saves the dialog.

You should consider using template parameters instead. See https://documentation.magnolia-cms.com/display/DOCS/Template+definition#Templatedefinition-Customtemplateproperties. Then in your script first check to see if any content exists. If not, fall back to the parameter value.

<p>${content.myField!def.parameters.myParameter}</p>

HTH

Generated at Mon Feb 12 09:14:37 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.