May 27, 2020
Estimated Post Reading Time ~ < 1 Min

How To Set Dynamic Value For Component Edit Bar Label

Sample code in JSP
you can set the label value of the component edit bar dynamically.
editbar
editContext is implicit object of com.day.cq.wcm.api.components.EditContext interface

editContext.getEditConfig().getToolbar().add(0, new Toolbar.Label("sample"));

By Using cq:EditConfig
Add the below configurations under your component's "cq:EditConfig" node

<cq:actionConfigs jcr:primaryType="nt:unstructured">
<separator
jcr:primaryType="nt:unstructured"
xtype="tbseparator"/>
<manage
jcr:primaryType="nt:unstructured"
handler="function(){&#xa;&#x9;window.open(CQ.WCM.getPagePath()+&quot;.openNewPage.html&quot;, '_blank');&#xa;}"
text="Edit on Other Page"/>
</cq:actionConfigs>
aem4beginner.blogspot


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.

Ad Blocker Detected :(

Please consider supporting us by disabling your ad blocker.

Please Disable your adblocker and Refresh the page to view the site content.