Dialog issues
Purpose: Fix dialogs that won't open, show missing fields, or don't persist values.
Who this page is for
| Audience | Why it matters to you |
|---|---|
| All engineers | Author-facing breakage is high-visibility |
Dialog won't open / spins
Browser dev-tools console first — dialog failures are usually a 500 on the dialog render or a JS error:
| Finding | Cause |
|---|---|
500 on _cq_dialog.html request | Malformed dialog XML — error.log names the offending node |
| JS error from a granite widget | Bad/unknown sling:resourceType on a field, or a broken custom widget clientlib |
| Dialog opens empty | .content.xml structure broken below the tab/items level (silently swallows children) |
Validate structure against a known-good dialog (copy a Core Component's dialog XML shape — nesting of content/items/tabs/items/… is strict and unforgiving).
Fields missing
- Node nesting: a field outside the expected
itemschain simply doesn't render. - Inherited dialogs: with
sling:resourceSuperType, your dialog replaces the parent's unless you use dialog merging viasling:hideResource/granite overrides carefully — check what the effective dialog is (request<component>/_cq_dialog.htmldirectly). - show/hide rules (
granite:class+ custom JS) mis-hiding fields — toggle in dev-tools.
Values not saving / not appearing
| Check | Explanation |
|---|---|
name attribute on each field (./title) | No name = no persistence; wrong prefix = wrong node |
| POST in dev-tools network tab on save | 200? The values are in the JCR — your HTL/model reads the wrong property |
| Multifield: composite + correct child naming | Rows saved flat vs child nodes mismatch with @ChildResource expectations (Lab 4/5) |
| Type hints (checkbox @TypeHint) | Booleans saved as strings break typed injection |
| Author sees old values after save | Overlay/CDN caching author URLs (author must never be CDN-cached) |
The "worked yesterday" case
Dialog changes deploy with code — diff the dialog XML in git; an innocent-looking reformat that reordered jcr:primaryType or dropped a namespace is the usual culprit (build failures for XML validity).