Expand my Community achievements bar.

SOLVED

Dialog with absolute name attributes

Avatar

Level 2

I am looking to store the information of a component dialog in a static position in the repository, I am trying to store the information in the principal page in the below way:

<?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:Dialog" title="Breadcrumb" xtype="dialog"> <items jcr:primaryType="cq:Widget" xtype="tabpanel"> <items jcr:primaryType="cq:WidgetCollection"> <tab1 jcr:primaryType="cq:Panel" title="Breadcrumb Configuration"> <items jcr:primaryType="cq:WidgetCollection"> <items jcr:primaryType="cq:WidgetCollection"> <absParent jcr:primaryType="nt:unstructured" defaultValue="2" fieldLabel="Parent Level (absolute)" name="/content/principalpage/jcr:content/breadcrumb/absParent" xtype="textfield"/> <delim jcr:primaryType="nt:unstructured" defaultValue=" > " fieldLabel="Delimiter" name="/content/principalpage/jcr:content/breadcrumb/delim" xtype="textfield"/> </items> </items> </tab1> </items> </items> </jcr:root>

With this dialog configuration the information is stored in the correct position in the repository, but it is not been recovered appropriately. Someone can help me?

Thank you.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi Miguel,

ExtJs allows you to extend object(CQ.Ext.extend) and override the default behaviour with your custom logic.

In this way you could: override setValue and getValue that would invoke CQ.HTTP and retrieve and set the "absolute" common value every time on every page.

Then instead of referencing the default textfield provided by CQ you would reference your custom absolutetextfield xtype in the dialog.xml

Peter

View solution in original post

4 Replies

Avatar

Level 10

Are you setting up the dialog node properties correctly. If you do -- the values in the dialog text field boxes are displayed when you open the dialog. If you do not setup these props on the textfield xtype -- values are not stored properly:

[img]props.png[/img]

When everything is setup correctly -- the values are persisted in the dialog and retrieved, as shown here;

[img]Code.png[/img]

Here is a new community article that guides you through how to successfully build a dialog that stores and retrieved values. This dialog is used for a custom carousel component. 

http://scottsdigitalcommunity.blogspot.ca/2013/09/integrating-cq-custom-map-component.html

HTH

Avatar

Level 2

Then it is not possible to create a Dialog with components getting the values out of the component without use the Design Dialog?

I need to create a component with a dialog with absolute paths. In that way all the components in a Site share the same values. Or do you know another possibility?

Thanks.

Miguel.

Avatar

Employee

Miguel-

The design dialog would generally be the more idomatic way to handle what you're describing. That said, it is definitely possible to have a field load its content from some other location. It is not, however, handled automatically; you must write some JavaScript code in the field's beforeloadcontent event listener. The listener can do whatever it wants to load the field's value and then return false.

Regards,

Justin

Avatar

Correct answer by
Community Advisor

Hi Miguel,

ExtJs allows you to extend object(CQ.Ext.extend) and override the default behaviour with your custom logic.

In this way you could: override setValue and getValue that would invoke CQ.HTTP and retrieve and set the "absolute" common value every time on every page.

Then instead of referencing the default textfield provided by CQ you would reference your custom absolutetextfield xtype in the dialog.xml

Peter