I have to create a button inside a component dialog. Kindly advise on how to do it
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Sanjana12,
You can use one of below:
Here is simple code example of Button usage.
<cq:dialog jcr:primaryType="nt:unstructured" jcr:title="Properties" sling:resourceType="cq/gui/components/authoring/dialog"> <content jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"> <items jcr:primaryType="nt:unstructured"> <column jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/container"> <items jcr:primaryType="nt:unstructured"> <text jcr:primaryType="nt:unstructured" fieldLabel="Text" name="./text" sling:resourceType="granite/ui/components/coral/foundation/form/textfield"/> <path jcr:primaryType="nt:unstructured" fieldLabel="Path" filter="nosystem" name="./path" rootPath="/content/dam" sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"/> <button jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/button" text="Button" type="button" /> </items> </column> </items> </content> </cq:dialog>
And the result:
Hi @Sanjana12,
You can use one of below:
Here is simple code example of Button usage.
<cq:dialog jcr:primaryType="nt:unstructured" jcr:title="Properties" sling:resourceType="cq/gui/components/authoring/dialog"> <content jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"> <items jcr:primaryType="nt:unstructured"> <column jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/container"> <items jcr:primaryType="nt:unstructured"> <text jcr:primaryType="nt:unstructured" fieldLabel="Text" name="./text" sling:resourceType="granite/ui/components/coral/foundation/form/textfield"/> <path jcr:primaryType="nt:unstructured" fieldLabel="Path" filter="nosystem" name="./path" rootPath="/content/dam" sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"/> <button jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/button" text="Button" type="button" /> </items> </column> </items> </content> </cq:dialog>
And the result:
Use below resourcetype for dialog field
granite/ui/components/coral/foundation/button
Add button resource in component dialog xml
<button jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/button"
text="Button"
type="button" />
Button resource-https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/...
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies