Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Implement Pathbrowser

Avatar

Level 4

Hello Community - I have a requirement to create a utility page that has a button on it. On click of the button, we need to open a pathbrowser and let the authors select the page/html. There is no dialog option for this scenario. The utility is based on JSP. Has anyone implemented such scenarios? If so, could you please provide some samples for the same?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@s1101v with Touch UI, your dialogue can be set up using the "Path Field", Granite UI 1.0 syntax:

 

<pathfield-example-logoPath
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
    fieldLabel="Logo Path"
    name="./logoPath"
    required="true"
    rootPath="/content/dam"/>

 

Source: https://sourcedcode.com/blog/aem/aem-granite-ui-1-0-form-components-xml-reference-guide#granite-ui-p... 

View solution in original post

7 Replies

Avatar

Correct answer by
Community Advisor

@s1101v with Touch UI, your dialogue can be set up using the "Path Field", Granite UI 1.0 syntax:

 

<pathfield-example-logoPath
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
    fieldLabel="Logo Path"
    name="./logoPath"
    required="true"
    rootPath="/content/dam"/>

 

Source: https://sourcedcode.com/blog/aem/aem-granite-ui-1-0-form-components-xml-reference-guide#granite-ui-p... 

Avatar

Level 5
@BrianKasingli - I am not looking for the Touch UI dialog syntax. My requirement is to open the pathbrowser ui to let the authors to select the pages. Like a browse option to select the pages. In JSP, I have a button, on click of button, I need to open the popup for the page selection.

Avatar

Community Advisor
Why don't you use the Granite UI for this?

Avatar

Level 5
@BrianKasingli - On click of button, what should I call to invoke/open the popup window? As this is not a touch ui dialog.

Avatar

Community Advisor

Why can't you allow authors to author the page in a standardise AEM way? Why re-create the wheel when tools are available for you?

Avatar

Level 5
@@BrianKasingli - This is basically a utility page. Authors will select the page, we need to bring the active elements that belong to the page. Also there wont be any authorable items in the page. It is kind of a form.

Avatar

Community Advisor
viki1101, in this case, then you would need to create a custom servlet that will expose the targeted pages within a drop down list, SELECT html element. Using JavaScript you can fill in the select drop down to show option for the authors to choose.