why to use ./ while giving a name for cq:widget | Community
Skip to main content
susheel
Level 5
Oct 16, 2015 2:28 AM UTC
Solved

why to use ./ while giving a name for cq:widget

why do we use ./ while giving a name for cq:widget. I didnt find any answer about it anywhere clearly. Is it a stardard way to do it or there is some meaning to it ? I am newbie.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

That is how we name widgets in the CQ dialog nodes. Assume we name a multi-field widget ./multi. THen in the JSP code - we can reference it without the ./. Therefore it is multi- as shown here:

if (prop.getDefinition().isMultiple() && (name.equalsIgnoreCase("multi")

{

//Do whatever

}

To see this - see this article -- https://helpx.adobe.com/experience-manager/using/creating-custom-xtype.html

5 replies

viveksachdeva
New Participant
Jul 13, 2017 7:55 AM UTC

This is based on Sling convention. Take a look at Apache Sling - Manipulating Content - The SlingPostServlet (servlets.post)

Translate
Lokesh_Shivalingaiah
Level 10
Oct 16, 2015 2:28 AM UTC

As far I know, its a standard way to do it for all the variables to hold the value of the widget

Translate
edubey
Level 10
Oct 16, 2015 2:28 AM UTC

Hi Susheel,

here are my views:

In AEM every piece of content is treated as resource. if you have name = ./textValue, you might notice name is given as a relative path.

This is where REST comes into picture, now when you can easily access this value via path /content/project/en/demo/jcr:content/right-side-content/text-component/textValue.json [ its project specifc, your might be different.]

As /content/project/en/demo/jcr:content/right-side-content/text-component  is your component path in crxde

"./" denotes next relative path which is ./textValue.

Which adds up to give you a resource path to /content/project/en/demo/jcr:content/right-side-content/text-component/textValue.json 

This is what I feel from AEM, sling, REST point of view. 

Thanks

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

That is how we name widgets in the CQ dialog nodes. Assume we name a multi-field widget ./multi. THen in the JSP code - we can reference it without the ./. Therefore it is multi- as shown here:

if (prop.getDefinition().isMultiple() && (name.equalsIgnoreCase("multi")

{

//Do whatever

}

To see this - see this article -- https://helpx.adobe.com/experience-manager/using/creating-custom-xtype.html

Translate
susheel
susheelAuthor
Level 5
Oct 16, 2015 2:28 AM UTC

smacdonald2008 wrote...

That is how we name widgets in the CQ dialog nodes. Assume we name a multi-field widget ./multi. THen in the JSP code - we can reference it without the ./. Therefore it is multi- as shown here:

if (prop.getDefinition().isMultiple() && (name.equalsIgnoreCase("multi")

{

//Do whatever

}

To see this - see this article -- https://helpx.adobe.com/experience-manager/using/creating-custom-xtype.html

 

I thought there is some special meaning to it.

Translate