Hello everybody, I want to start sharing my knowledge in CQ with this little and easy post. I will break the ice saying that Adobe CQ is an enterprise CMS that runs on a Java SE platform, which is built on standard technologies like JCR, the OSGi Framework and Apache Sling, but I will left the overview about CQ for another post and focus this one in our topic.
In CQ, the pathfield widget  is an input field designed to enter paths, providing path completion and server repository browsing capabilities via a browsing button located at the right side of the field. This widget is very useful to provide an easy way to get local links from the server content repository, or to select some kind of approved external links. The problem many times is that this browser mechanism can be skipped and the author may enter code manually, pointing to an arbitrary or non approved link. When you start developing in CQ (as with other languages) you may forget this kind of details, and in fact I did, but when you are reviewing code or fixing bugs they will became notorious. How to get rid of that? Setting editable as false will do the trick. See the code below,

Refer to the CQ Widgets API to get more information about the widget you are using.

2 Responses