Expand my Community achievements bar.

SOLVED

Conversion from design dialog to dialog

Avatar

Level 1

Currently I am using a component which is having design_dialog and it is associated with TLD or java classes. In the java classes various properties are read using using object of "Style" like Style currentStyle and reading properties like this: currentStyle.get("NAMEOFPROPERTY","DEFAULTVALUE"); Now i want to convert this design_dialog to dialog type. Simply changing from design_dialog to dialog doesn't worked, so what changes should I require to do?

1 Accepted Solution

Avatar

Correct answer by
Level 6

The Design Dialog and the Component Edit dialog is both are of the type cq:Dialog, so they should be interchangeable when you want to go from storing the properties in the design (share for all instances of the component) to store the properties in each instance of the component.

When you read from the current component, you use the properties map. If it is in a JSP file it would be like properties.get("NAMEOFPROPERTY", "DEFAULTVALUE");

When you read if from within the tag java code, you can then choose how to pickup the current component or property. If you can track down the node that you are working with, you can use something like node.getProperty("NAMEOFPROPERTY").getString();

Edit: I forgot that there is a named property that you can pick up from within the tag.

        final ValueMap properties = (ValueMap) pageContext.getAttribute("properties");

/Ove

View solution in original post

1 Reply

Avatar

Correct answer by
Level 6

The Design Dialog and the Component Edit dialog is both are of the type cq:Dialog, so they should be interchangeable when you want to go from storing the properties in the design (share for all instances of the component) to store the properties in each instance of the component.

When you read from the current component, you use the properties map. If it is in a JSP file it would be like properties.get("NAMEOFPROPERTY", "DEFAULTVALUE");

When you read if from within the tag java code, you can then choose how to pickup the current component or property. If you can track down the node that you are working with, you can use something like node.getProperty("NAMEOFPROPERTY").getString();

Edit: I forgot that there is a named property that you can pick up from within the tag.

        final ValueMap properties = (ValueMap) pageContext.getAttribute("properties");

/Ove