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
Solved! Go to Solution.
Views
Replies
Total Likes
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).
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).
Thanks a lot for your response.
I am looking to show and hide an item inside a multifield.
So case is I have a multifield with say 3 items. With selection of first two no action required. For selection of third item, I am showing a textfield (required). Now since this is a multifield suppose I author three items. First two with options 1 and 2 (no condition items) and the third multifield item with third option for which the show-texfiield should show up. The issue is since I am using a class name say - ".mytype-showhide" the textfield that should appear for third item appears for all three now since the class is not unique for each multifield item, rather all of the items. I tried using ".mytype-showhide-${requestPathInfo.suffix}" for the 'cq-dialog-dropdown-showhide-target' but that is also same for all three items obviously for eg: mytypeshow-hide-/content/path/to/page/jcr:content/contentArea/mymultifieldcomp_651549243
Another option I could try is your solution on this post (https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem6-4-multifield-with-sho...) But I am looking to avoid adding a js for this.
If I could add something to 'cq-dialog-dropdown-showhide-target' on the granite:data node that would by unique for each multifield item seems like it would probably solve the issue. But not sure if that is possible without adding custom js logic. I don't have an insight (or knowledge) about what other interfaces (or other correct term) are available on each multifield item for 'cq-dialog-dropdown-showhide-target' property.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
@Shubham_boroleIf 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...
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies