How to filter CQ.form.PathField options according to the template? | Community
Skip to main content
Marcelo___ciand
New Participant
March 17, 2016
Solved

How to filter CQ.form.PathField options according to the template?

  • March 17, 2016
  • 3 replies
  • 2172 views

Folks,

I want to use a CQ.form.PathField in a dialog to allow the author to choose a page. However I would like to limit the options to pages that were built using a certain template. The options to filter content based on the path or page name are not applicable. A custom predicate does not seem to work either, since it would discard parent nodes that do not implement my template, but that could potentially have children that do.  

Is the only solution here to extend CQ.form.PathField?

Any thoughts?

Thanks,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by stevec2515680

There is another article that may be helpful to you: 

https://helpx.adobe.com/experience-manager/using/creating-custom-cq-tree.html

It talks about how to populate a control (could be a control in a dialog) using JS that makes a call to Server-side Java code. On the Java side - you can control what data to display in the control. 

3 replies

stevec2515680Accepted solution
New Participant
March 17, 2016

There is another article that may be helpful to you: 

https://helpx.adobe.com/experience-manager/using/creating-custom-cq-tree.html

It talks about how to populate a control (could be a control in a dialog) using JS that makes a call to Server-side Java code. On the Java side - you can control what data to display in the control. 

Marcelo___ciand
New Participant
March 17, 2016

Steve,

Thanks for the reply. I read the article and got the idea. At the end I would have to customize the interaction to the server that fetches the tree nodes. 

New Participant
March 17, 2016

You would write a custom xtype that uses a CQ.form.PathField. In that JS code, you can dynamically set the values you want for the PathField instance. You cannot do this by setting nodes and properties. It has to be done via code. See the following article that has script named developers.js. This will point you in the right direction: 

https://helpx.adobe.com/experience-manager/using/jstl.html

In addition - here is the reference docs for this object: 

https://docs.adobe.com/docs/en/cq/5-3/widgets-api/index.html?class=CQ.form.PathField

Hope this helps