Dialog problem | Community
Skip to main content
October 16, 2015
Solved

Dialog problem

  • October 16, 2015
  • 6 replies
  • 1654 views

Hi,i've a problem with a dialog editor, whith a dialogfieldset nested in a checkable fieldset.

All is rendered fine, but when i put some values and click save, no values seems to be saved (after re-opening dialog only checkable field is stored).

Can anyone help me? Thanks

 

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="cq:Widget" title="Buttons"> <items jcr:primaryType="cq:WidgetCollection"> <buttons jcr:primaryType="cq:Widget" inputValue="{Boolean}true" name="./has_buttons" title="Add buttons" xtype="checkablefieldset"> <items jcr:primaryType="cq:WidgetCollection"> <button1 jcr:primaryType="cq:Widget" xtype="dialogfieldset" collapsed="{Boolean}false" collapsible="{Boolean}true" title="Button1 Configuration"> <items jcr:primaryType="cq:WidgetCollection"> <style jcr:primaryType="cq:Widget" fieldLabel="Style" fieldDescription="Insert a css class to change button rendering (es. white) " name="./button_style" xtype="textfield"> </style> <label jcr:primaryType="cq:Widget" fieldLabel="Label" name="./button_label" xtype="textfield"/> <link jcr:primaryType="cq:Widget" fieldDescription="Drop pages from the Content Finder or insert an external url" fieldLabel="Link" name="./button_link" defaultValue="#" xtype="pathfield" width="auto"/> <jslink jcr:primaryType="cq:Widget" fieldLabel="External link" fieldDescription="Check only for external call to action (external websites or javascript)" name="./button_jslink" type="checkbox" defaultValue="{Boolean}false" xtype="selection"/> <rel jcr:primaryType="cq:Widget" defaultValue="follow" fieldDescription="Default value: follow" fieldLabel="Index attribute (rel)" name="./button_rel" type="select" xtype="selection"> <options jcr:primaryType="cq:WidgetCollection"> <follow jcr:primaryType="nt:unstructured" text="follow" value="follow"/> <nofollow jcr:primaryType="nt:unstructured" text="nofollow" value="nofollow"/> </options> </rel> <target jcr:primaryType="cq:Widget" defaultValue="_self" fieldDescription="Default value: _self" fieldLabel="Target attribute" name="./button_target" type="select" xtype="selection"> <options jcr:primaryType="cq:WidgetCollection"> <blank jcr:primaryType="nt:unstructured" text="_blank" value="_blank"/> <parent jcr:primaryType="nt:unstructured" text="_parent" value="_parent"/> <self jcr:primaryType="nt:unstructured" text="_self" value="_self"/> <top jcr:primaryType="nt:unstructured" text="_top" value="_top"/> </options> </target> </items> </button1> </items> </buttons> </items> </jcr:root>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

Occurring on all browser?  In any case file daycare issue.

6 replies

smacdonald2008
October 16, 2015

What CQ version are you using. 

Sham_HC
Sham_HCAccepted solution
October 16, 2015

Occurring on all browser?  In any case file daycare issue.

essewebAuthor
October 16, 2015

Thanks smacdonald2008, i'm using CQ5 5.6.1

smacdonald2008
October 16, 2015

To properly store/persist/display values in a component dialog, you can create app logic to invoke a custom sling servlet. Pass the values to the sling servlet that you want to store the values in the JCR. Also, when you open the dialog- call the servlet, get the values and populate the dialog fields that you want to display the data in.

You can invoke back end servlets from xtypes. See this community article as an example:

Invoking Sling Servlets from AEM xtype widgets

You can also write a custom xtype, and use code to define the dialog fields and invoke the servlet too. Populate the dialog fields using JS logic within the custom xtype. 

essewebAuthor
October 16, 2015

ok. You're saying that this isn't made automatically...

In general for other kinds of dialog I don't need to write custom server logic to retrieve stored values,

essewebAuthor
October 16, 2015

It seems values appear in dialog fieldset just for 1 second. So i think are retrieved in the right way but for some reason immediately deleted.

Any ideas? I