Variable value to granite:class

Avatar

Avatar
Boost 100
Level 6
snbaem
Level 6

Likes

112 likes

Total Posts

245 posts

Correct reply

35 solutions
Top badges earned
Boost 100
Springboard
Establish
Validate 25
Validate 10
View profile

Avatar
Boost 100
Level 6
snbaem
Level 6

Likes

112 likes

Total Posts

245 posts

Correct reply

35 solutions
Top badges earned
Boost 100
Springboard
Establish
Validate 25
Validate 10
View profile
snbaem
Level 6

02-07-2021

Hello All,

I am trying to add a dynamic value to a granite:class property. (To be used inside a multifield)

 

<type jcr:primaryType="nt:unstructured"
                          granite:class="unique-class-${requestPathInfo.suffixResource}"
                          sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
.....
</items>
</type>

 

In above eg, ${requestPathInfo.suffixResource} is surely not a variable. however I am looking for something I can use here that would be unique. Does anyone have any idea what else is accessible here? Like RequestPathInfo interface are there any other interfaces available that can be accessed here?

 

Thanks

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,431 likes

Total Posts

3,305 posts

Correct reply

937 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,431 likes

Total Posts

3,305 posts

Correct reply

937 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

03-07-2021

Hi,

What is your use case?

if you want to uniquely identified the component from FED, you can do it by calling 'Granite.author.DialogFrame.currentDialog.editable.path'

for dialog ${requestPathInfo.suffix} returns the unique value(authored component path in jcr).

Answers (1)

Answers (1)

Avatar

Avatar
Affirm 1
Level 2
shellygoel06
Level 2

Likes

4 likes

Total Posts

4 posts

Correct reply

1 solution
Top badges earned
Affirm 1
Boost 3
Boost 1
View profile

Avatar
Affirm 1
Level 2
shellygoel06
Level 2

Likes

4 likes

Total Posts

4 posts

Correct reply

1 solution
Top badges earned
Affirm 1
Boost 3
Boost 1
View profile
shellygoel06
Level 2

10-07-2021

@snbaemIf you're still looking for a solution without extraClientlibs then you can refer here: https://levelup.gitconnected.com/aem-conditionally-show-or-hide-fields-in-touchui-dialogs-with-coral...