Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

AEM6.3 coral touch ui building custom predicate for Pathbrowser or pathfield

srinivas_chann1
Level 7
Level 7

Hi ,

On touch ui dialog ,I am using pathbrowser with predicate as "nosystem"  this shows all the sub-nodes available on the page components. But the issue I have is,it shows the sub-nodes of the components available on the page also ,which we don't need.

We would want to restrict the node level  only to nodes below par to "/content/page/jcr:content/par/..."  .

<reference

                                        jcr:primaryType="nt:unstructured"

                                        sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"

                                        fieldLabel="Reference"

                                        margin="{Boolean}true"

                                        name="./path"

                                        predicate="nosystem"

                                        rootPath="/content"/>

Please let me know how this could be achieved.  I saw few examples as https://stackoverflow.com/questions/41677562/how-to-filter-the-pages-visible-in-an-aem-granite-ui-pa...

But i would  want a full sample code of AbstractNodePredicate  which i could use and change. Please help

Thanks

1 Reply
srinivas_chann1
Level 7
Level 7

I noticed that for pathfield it is mentioned with property as filter. So in that case i need to write custom filter ,could some provide  sample code will be helpful.

<reference

                                        jcr:primaryType="nt:unstructured"

                                        sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"

                                        fieldLabel="Reference"

                                        margin="{Boolean}true"

                                        name="./path"

                                        filter="nosystem"

                                        rootPath="/content"/>